Laravel 13
Laravel 13.x + PHP 8.3 rules for Cursor. Anti-Repository pattern stance (cites Otwell on Maintainable, Freek Van der Herten freek.dev/2422, Spatie boost-spatie-guidelines). Catches 37 LLM regressions including app/Http/Kernel.php (deleted in L11), app/Console/Kernel.php (deleted in L11), RouteServiceProvider regeneration, $casts array (use casts() method), scopeActive() (use #[Scope]), wire:model.lazy (Livewire 3 rename, default-deferred in Livewire 4), ShouldBeUnique inside Bus::batch(), Carbon 2 calls (Carbon 3 mandatory in L12+), image rule expecting SVG (use image:allow_svg), $guarded = [], five-default-providers register, Mix asset compilation (Vite is default), Pest 4 vs PHPUnit, Filament 3 resource shape, Octane defaulting Swoole when FrankenPHP is recommended.
What’s inside
5 skills- Skilllaravel-migrate-v10-to-v13Migrate a Laravel 10 (or earlier) project to Laravel 13. Stages: composer.json bumps (PHP 8.3, Carbon 3, Pest 4), bootstrap/app.php scaffold replacing app/Http/Kernel.php + app/Console/Kernel.php + app/Providers/RouteServiceProvider.php, bootstrap/providers.php replacing config/app.php providers array, $casts -> casts() method, scopeXxx() -> #[Scope] attribute, install:api / install:broadcasting opt-ins, removed config files audit (broadcasting/cors/hashing/sanctum/view), Mix -> Vite, Carbon 2 -> 3 method renames, validateSignatures(except: [...]) for UTM tracking, image rule -> image:allow_svg if SVG was previously accepted, PHPUnit -> Pest 4 conversion. Surfaces every anti-pattern and provides a migration plan.
- Skilllaravel-n+1-auditFind N+1 query patterns and fix them. Workflow: enable Model::shouldBeStrict in dev to make lazy loads throw, run the test suite, fix each LazyLoadingViolation by adding with()/withCount(), or globally enable automaticallyEagerLoadRelationships() (L12.8+). Surfaces the worst offenders via Pulse, Telescope, Debugbar, or Clockwork; confirms with EXPLAIN; teaches the difference between automatic vs manual eager loading.
- Skilllaravel-new-actionScaffold a new Action class under app/Actions/<Verb><Noun>.php. Final readonly class, single __invoke method, dependency-injected constructor, optional DB::transaction wrapper, optional event dispatch. Pushes business logic out of controllers and refuses the Repository pattern. Pairs with the laravel-eloquent and laravel-controllers-and-actions rules.
- Skilllaravel-new-form-requestScaffold a FormRequest under app/Http/Requests/<Verb><Noun>Request.php with rules(), authorize(), messages(), prepareForValidation(), and (optionally) attributes(). Refuses inline $request->validate() for non-trivial inputs (anti-pattern #10). Pairs with the laravel-controllers-and-actions rule.
- Skilllaravel-validateRun the Laravel quality stack: Pint (formatter), Larastan (PHPStan with Laravel types) at level 8 or higher, Pest 4 with parallel runs, and a grep audit for the tracked anti-patterns (Kernel.php presence, Repository classes, $casts arrays, scopeXxx methods, $guarded = [], wire:model.defer/lazy, Mix usage, Carbon 2 method calls, image rule without :allow_svg, removed config files, providers in config/app.php). Returns severity-tagged findings.