Documentation Index
Fetch the complete documentation index at: https://kawax.biz/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
This guide walks you through migrating a Laravel 10 application — with itsKernel classes and multiple service providers — to the Slim Application Skeleton introduced in Laravel 11.
When you might consider migrating
You might consider this migration when:- You want to align the project with the latest official conventions so new team members can follow the documentation directly.
- You want consistency with packages and starter kits created with Laravel 11 or later.
- You want to simplify the codebase by removing legacy configuration files and classes that came from the old structure.
Prerequisites
This guide assumes the following:- You have already upgraded the Laravel framework to
laravel/framework ^11.0or later. - All existing tests pass.
- You understand the Laravel 11+ application structure.
Migration example
The steps below show how to migrate a project that was originally created with Laravel 10 + Breeze (Blade stack), keeping Breeze in place while updating only the application structure.Replace bootstrap/app.php
The old After (Laravel 11+):
bootstrap/app.php created an $app instance and registered the kernel classes. Replace it with the Application::configure() fluent chain.Before (Laravel 10):Leave the
withMiddleware() and withExceptions() callbacks empty for now. You will populate them in later steps when you migrate customizations from the kernel files you are about to remove.Remove the HTTP kernel (app/Http/Kernel.php)
app/Http/Kernel.php defined global middleware, middleware groups, and middleware aliases.Before (app/Http/Kernel.php):app/Http/Kernel.php directly.If you do have customizations (custom middleware added or removed), migrate them to withMiddleware() in bootstrap/app.php before deleting the file:app/Http/Kernel.php.In Laravel 11, the default middleware classes such as
TrustProxies, EncryptCookies, and VerifyCsrfToken are also no longer needed in app/Http/Middleware/. If you have not customized them, you can delete those files too — the framework provides the defaults internally.Remove the Console kernel (app/Console/Kernel.php)
app/Console/Kernel.php was responsible for defining the schedule and auto-loading commands.Before (app/Console/Kernel.php):app/Console/Commands/, so the $this->load() call is no longer needed.Schedule definitions: Move them to routes/console.php or to withSchedule() in bootstrap/app.php:app/Console/Kernel.php.Do not delete your custom Artisan command files inside
app/Console/Commands/. Only the Kernel.php class file should be removed.Remove the exception handler (app/Exceptions/Handler.php)
app/Exceptions/Handler.php configured exception reporting and rendering.Before (app/Exceptions/Handler.php):withExceptions() in bootstrap/app.php before deleting the file:$dontFlash, you can migrate them like this:app/Exceptions/Handler.php.Remove RouteServiceProvider and migrate route registration
app/Providers/RouteServiceProvider.php loaded route files and configured rate limiting.Before (app/Providers/RouteServiceProvider.php):withRouting() in bootstrap/app.php:AppServiceProvider::boot():HOME constant anywhere in the codebase, replace it with the URL string directly or move the constant to AppServiceProvider.After migrating, delete app/Providers/RouteServiceProvider.php.Consolidate service providers
Laravel 10 shipped with five default service providers. Consolidate them into a single
Example: migrating After deleting the individual provider files, remove them from the Then create
AppServiceProvider.php.Providers to remove (migrate their contents to AppServiceProvider first):| File | Migration target |
|---|---|
app/Providers/AuthServiceProvider.php | Gate::policy() calls in AppServiceProvider::boot() |
app/Providers/BroadcastServiceProvider.php | withBroadcasting() in bootstrap/app.php (if using Broadcasting) |
app/Providers/EventServiceProvider.php | Event::listen() calls in AppServiceProvider::boot() |
app/Providers/RouteServiceProvider.php | Already handled in the previous step |
AuthServiceProvider:providers array in config/app.php:bootstrap/providers.php to switch to the new structure:When
bootstrap/providers.php exists, Laravel uses it as the authoritative list of service providers and ignores the providers array in config/app.php.Update the base Controller class
The Laravel 10 After (Laravel 11+):Replace calls to the trait methods as follows:
If your existing controllers call trait methods, you can either update each controller individually or keep the traits in the base
Controller base class used the AuthorizesRequests and ValidatesRequests traits. The new base class is a simple abstract class with no traits.Before (Laravel 10):| Old approach (via trait) | New approach |
|---|---|
$this->validate($request, $rules) | $request->validate($rules) |
$this->authorize('update', $post) | Gate::authorize('update', $post) |
$this->authorizeResource(Post::class) | No simple equivalent — keep the Laravel 10 traits in Controller if needed |
Controller class. Both approaches work — you do not need to change everything at once.Remove unused config files
Config files such as
config/cors.php, config/hashing.php, and config/view.php can be deleted if you have not changed them from their defaults — the framework ships with built-in defaults for all of these. Keep any file where you have made actual changes.Update tests/TestCase.php
The
CreatesApplication trait is no longer needed. Update tests/TestCase.php and delete tests/CreatesApplication.php:Update .env, .env.example, and phpunit.xml
Some environment variables were renamed between Laravel 10 and 11 — for example,
CACHE_DRIVER became CACHE_STORE. Update these files if necessary, but keep in mind that changes here also affect your config files and production environment. There is no need to rush these updates; they can be done incrementally.File structure after migration
The following shows what your project should look like after completing the migration (changes from the old structure are noted):Summary
| What changed | Old location | New location |
|---|---|---|
| HTTP middleware | app/Http/Kernel.php | withMiddleware() in bootstrap/app.php |
| Exception handling | app/Exceptions/Handler.php | withExceptions() in bootstrap/app.php |
| Schedule definitions | app/Console/Kernel.php | routes/console.php |
| Route registration | app/Providers/RouteServiceProvider.php | withRouting() in bootstrap/app.php |
| Service provider list | providers array in config/app.php | bootstrap/providers.php |
| Policy registration | app/Providers/AuthServiceProvider.php | Auto-discovered, or AppServiceProvider::boot() |
| Event listeners | app/Providers/EventServiceProvider.php | Auto-discovered, or AppServiceProvider::boot() |