agentskills.codes
LA

laravel-attributes

Use whenever writing or reviewing Laravel PHP code (Laravel 13+). Prefer PHP attributes over class properties for models, jobs, commands, controllers, form requests, tests, factories, API resources, and container bindings. Trigger on $fillable, $table, $queue, $tries, $signature, $redirect, $errorBa

Install

mkdir -p .claude/skills/laravel-attributes && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17184" && unzip -o skill.zip -d .claude/skills/laravel-attributes && rm skill.zip

Installs to .claude/skills/laravel-attributes

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Use whenever writing or reviewing Laravel PHP code (Laravel 13+). Prefer PHP attributes over class properties for models, jobs, commands, controllers, form requests, tests, factories, API resources, and container bindings. Trigger on $fillable, $table, $queue, $tries, $signature, $redirect, $errorBag, $seeder, constructor middleware, singleton registration, and any new Laravel class.
386 charsno explicit “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)

About this skill

Laravel PHP Attributes (Laravel 13+)

Rather than scattering configuration across class properties, Laravel lets you declare intent directly above the class using PHP attributes. It's cleaner, more expressive, and easier to scan.

Before writing a class property, check the README — there's likely an attribute for it. Open the relevant file under attributes/ to get the exact namespace and parameters, then apply it. Always include the use import — attributes do nothing without it.

Examples

Model

use Illuminate\Database\Eloquent\Attributes\{Table, Fillable, Hidden, Connection};

#[Table('users')]
#[Fillable('name', 'email')]
#[Hidden('password')]
#[Connection('mysql')]
class User extends Model {}

Job

use Illuminate\Queue\Attributes\{Connection, Queue, Tries, Timeout, Backoff};

#[Connection('redis')]
#[Queue('orders')]
#[Tries(3)]
#[Timeout(60)]
#[Backoff(30)]
class ProcessOrder implements ShouldQueue {}

Command

use Illuminate\Console\Attributes\{Signature, Description};

#[Signature('users:sync {--force}')]
#[Description('Sync users from the external API')]
class SyncUsers extends Command {}

Form Request

use Illuminate\Foundation\Http\Attributes\{RedirectTo, RedirectToRoute, StopOnFirstFailure, ErrorBag};

#[RedirectTo('/profile')]
#[RedirectToRoute('profile.edit')]
#[StopOnFirstFailure]
#[ErrorBag('updateProfile')]
class UpdateProfileRequest extends FormRequest {}

Container binding — declare on the class rather than in a service provider. The class still needs to be resolved through the container (constructor injection, etc.) for the attribute to take effect.

use Illuminate\Container\Attributes\Singleton;

#[Singleton]
class StripeGateway implements PaymentGateway {}

PHP built-in

// Prevent sensitive values from leaking into stack traces
function login(string $user, #[\SensitiveParameter] string $password): void {}

Search skills

Search the agent skills registry