From superpowers-laravel
Use Laravel 13+ first-party PHP attributes for controller middleware, authorization, queue job config, and Eloquent model settings; colocate declarative config with code.
How this skill is triggered — by the user, by Claude, or both
Slash command
/superpowers-laravel:php-attributesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Laravel 13 expands attribute support across the framework. Prefer attributes when they colocate configuration with the class it affects and reduce boilerplate.
Laravel 13 expands attribute support across the framework. Prefer attributes when they colocate configuration with the class it affects and reduce boilerplate.
# Controller middleware + authorization
use Illuminate\Routing\Attributes\Controllers\Authorize;
use Illuminate\Routing\Attributes\Controllers\Middleware;
#[Middleware('auth')]
class CommentController
{
#[Middleware('subscribed')]
#[Authorize('create', [Comment::class, 'post'])]
public function store(Post $post) { /* ... */ }
}
# Queue job controls
use Illuminate\Queue\Attributes\{Tries, Backoff, Timeout, FailOnTimeout};
#[Tries(3)]
#[Backoff([10, 30, 60])]
#[Timeout(120)]
#[FailOnTimeout]
class ProcessPodcast implements ShouldQueue { /* ... */ }
# Eloquent model attributes
use Illuminate\Database\Eloquent\Attributes\{DateFormat, WithoutTimestamps};
#[DateFormat('Y-m-d')]
#[WithoutTimestamps]
class Post extends Model { /* ... */ }
#[Authorize] on controller actions keeps policy checks visible at the call site — see laravel:policies-and-authorization$tries/$backoff/$timeout properties — see laravel:queues-and-horizon#[Authorize] denials and retry behavior for #[Tries]npx claudepluginhub jpcaparas/superpowers-laravel --plugin superpowers-laravelMigrates Laravel Eloquent models, Jobs, Controllers, Console commands, API Resources, Validation, and Factories/Seeders to native PHP 8.3 attributes introduced in Laravel 13. Covers all 7 categories of first-party attributes.
Covers modern PHP 8.4 features and Laravel conventions: thin controllers, service/action classes, Eloquent, migrations, queues, and testing. Activates automatically for PHP files.
Guides Laravel 11+ development: architecture decisions, Eloquent ORM, authentication (Sanctum), queues, jobs, Livewire/Inertia, Blade, Artisan, Forge/Vapor, and testing with Pest/PHPUnit.