[11.x] Slim skeleton
https://github.com/laravel/laravel/pull/6188
Laravel 11 Framework Overview
Configuration
All configuration files now have framework counterparts and application level configuration is merged with the framework defaults. The default configuration files have also received many more environment variables so that more options can be changed from the application’s .env file. The LoadConfiguration bootstrap class has been added to support framework configuration cascading. A new config:publish command has been introduced to publish framework configuration files.
Middleware
The Authenticate middleware and AuthenticationException exception now have redirectUsing methods that accept a closure. This closure will be invoked to determine where to redirect unauthenticated users. Helper methods for setting this closure are available on the Middleware application builder class.
The Authenticate middleware also now does not return a redirect location if the incoming request expected JSON.
The RedirectIfAuthenticated middleware has been added to the framework. This middleware also includes a redirectUsing method to customize the “guest” redirection behavior. The default behavior is to redirect to /dashboard. Helper methods for setting this closure are available on the Middleware application builder class.
The AuthenticateSession middleware has received a redirectUsing helper to control the redirection behavior. Helper methods for setting this closure are available on the Middleware application builder class.
The TrimStrings middleware has received an except method that may be used to specify which strings should not be trimmed.
The ValidateCsrfToken middleware has received an except method that may be used to specify which paths should not receive CSRF token validation.
The ValidateSignature middleware has receive an except method that may be used to specify which parameters should not be included in signature validation.
ValidateCsrfToken has been added as an alias of VerifyCsrfToken.
The TrustHosts middleware has been updated to allow all subdomains of the application’s configured URL by default.
The TrustProxies middleware has been updated to trust all proxies by default.
The EncryptCookies middleware has received a static except method which may be used in a service provider to specify the cookies that should not be encrypted.
Events
The foundation EventServiceProvider has been updated to discover events by default. In addition, the email verification listener to send email verification notifications is now configured automatically if no Registered event listeners exist or the SendEmailVerificatioNotification listener is not in the list of listeners for the Registered event.
Notificiations
A slack configuration array has been added to the framework's copy of the services.php configuration file.
Artisan Commands
The cache:table command has received a make:cache-table alias to move all generation commands under the make namespace. The notifications:table command has receive a make:notifications-table alias to move all generation commands under the make namespace. The queue:batches-table command has received a make:queue-batches-table alias for the same reason as above. The queue:failed-table command has received a make:queue-failed-table alias for the same reason as above. In addition, queue:table has received a make:queue-table alias. Also, session:table has received a make:session-table alias.
A schedule command has been added to closure commands, allowing the fluent scheduling of closure commands in the console routes file.
The console scheduler is now available via a Schedule facade.
The optimize command now also caches views and events.
Service Providers
The RegisterProviders bootstrap class has been updated to support the loading of additional providers from the bootstrap/providers.php array file.
The make:provider command has been updated to add the new service provider to the bootstrap/providers.php file if it exists.
The ServiceProvider class has received a new static addProviderToBootstrapFile method that will add a service provider class to the bootstrap/providers.php file if it exists.
Application Configuration
The Application class has received several new methods and helpers. A new registered listener method has been added to allow code to react to the registration service providers. A new getBootstrapProvidersPath method has been added that returns the location to the bootstrap providers file. New handleRequest and handleCommands method have been added in order to clean up and simplify the application level bootstrap / index files.
A new configure method has been added to the Application class in order to allow the fluent configuration of multiple framework features, including routing and container bindings.
A new ApplicationBuilder class has been introduced to allow the easy configuration of a variety of core framework functionality, including routing, commands, middleware, exception handling, booting / booted callbacks, and more.
A new Middleware application configuration class has been introduced that allows the easy definition of new middleware groups, prepending and appending of middleware to existing groups, replacing middleware in existing groups, and fluent methods for enabling middleware like TrustHosts and EnsureFrontendRequestsAreStateful.
Helper methods have been added to the exception handler for dontReport, dontReportDuplicates, dontFlash, buildContextUsing.
Installers
A new install:api command has been added. This command installs laravel/sanctum and uncomments the “API” routes definition in the bootstrap file.
A new install:broadcasting has been added which uncomments the “channels” routes definition in the bootstrap file. In addition, a Laravel Echo file is written to the resources/js directory which contains the Echo configuration. A directive to include this file is injected into the main bootstrap.js file.