Skip to main content

Laravel 11: The Game-Changing New Features

Laravel 11 brings an exciting set of new features. Discover the capabilities set to transform the way you build your applications.

Laravel 11 marks a turning point in the evolution of the most popular PHP framework. Let's explore the most impactful new features together. ## Streamlined structure The base structure of a Laravel 11 application is considerably lighter: - No more default `app/Http/Middleware` directory - Centralized `bootstrap/app.php` file - Fewer configuration files ## New routing system Routing has been redesigned for greater clarity: ```php Route::get('/users', UserController::class); ``` ## Built-in Health Check Laravel 11 includes an `/up` endpoint for health checks: ```php Route::get('/up', function () { return response('OK'); }); ``` ## Improved Model Casts Casts are now more intuitive: ```php protected function casts(): array { return [ 'options' => AsCollection::class, 'created_at' => 'datetime:Y-m-d', ]; } ``` ## Dumpable Trait A new trait that makes debugging easier: ```php use Illuminate\Support\Traits\Dumpable; class User extends Model { use Dumpable; } $user->dd(); // Dump and die ``` ## Increased performance Laravel 11 is faster thanks to: - IoC container optimizations - Improved lazy loading - A revamped configuration cache ## Migrating to Laravel 11 Migrating from Laravel 10 is relatively straightforward. Follow the official guide and start taking advantage of the new features right away.