← ClaudeAtlas

laravel-11-noteslisted

Laravel 11.x (March 2024) signature features and the (significant) breaking-change traps from 10 → 11. Use when writing or reviewing code in a Laravel 11 project, or in a package whose composer constraint includes ^11.0. Covers the streamlined app structure (bootstrap/app.php replaces three Kernel/Handler files), the Model casts() method that replaces $casts property, per-second rate limiting, the /up health endpoint, SQLite-as-default, Sanctum 4, and the array-style middleware exception handling.
hmj1026/dhpk · ★ 1 · AI & Automation · score 72
Install: claude install-skill hmj1026/dhpk
# Laravel 11 — streamlined structure, casts() method, /up Released March 2024. PHP 8.2+ floor. **The biggest structural rework since 5.0** — upgraders should expect a real migration project, not a drop-in. --- ## Signature features ### Streamlined app structure Laravel 11 collapses three previously-separate configuration files into one: | Before (L ≤10) | After (L 11) | |---|---| | `app/Http/Kernel.php` (middleware) | `bootstrap/app.php` (middleware section) | | `app/Console/Kernel.php` (scheduled tasks) | `bootstrap/app.php` (commands section) | | `app/Exceptions/Handler.php` (exception handling) | `bootstrap/app.php` (exceptions section) | ```php // bootstrap/app.php return Application::configure(basePath: dirname(__DIR__)) ->withRouting( web: __DIR__ . '/../routes/web.php', api: __DIR__ . '/../routes/api.php', commands: __DIR__ . '/../routes/console.php', health: '/up', ) ->withMiddleware(function (Middleware $middleware) { $middleware->web(append: [EnsureUserIsSubscribed::class]); }) ->withExceptions(function (Exceptions $exceptions) { $exceptions->render(function (NotFoundHttpException $e, Request $request) { return response()->json(['error' => 'not found'], 404); }); })->create(); ``` **Upgrade trap**: Laravel 10 → 11 upgraders can **keep** the old three-file layout. Laravel ships Backport classes that let `app/Http/Kernel.php` work in 11. Don't feel pressured