Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon Laravel 11 problematic changes
    Laravel 11


Laravel 11 problematic changes


Laravel 11 introduces several significant changes that may present challenges for developers migrating from previous versions. Here are some of the problematic changes identified:

Key Changes and Issues

1. Middleware Registration

In Laravel 11, middleware has been relocated to the `bootstrap/app.php` file, eliminating the dedicated middleware directory and the traditional `app\Http\Kernel.php` file. This requires developers to manually register middleware, which can complicate the migration process, especially for those accustomed to the previous structure[1][2].

2. Routing Structure

The default routing files for API and broadcasting (`api.php` and `channels.php`) are no longer included. Developers must create these files manually using Artisan commands (`php artisan install:api` and `php artisan install:broadcasting`). This change may disrupt workflows that relied on these files being present by default[1][2].

3. Scheduling Changes

Scheduled tasks must now be defined directly in `routes/console.php`, rather than in a separate console kernel class. This consolidation may lead to confusion for developers who are used to the previous separation of concerns[1][2].

4. Database Driver Configuration

The default database driver in the `.env` file has been set to SQLite in Laravel 11. This can lead to confusion for developers who primarily use MySQL, as they may encounter errors related to missing drivers if they do not change this setting immediately after installation[5].

5. Migration Management

Changes in how migrations are handled may pose challenges, particularly for projects with a large number of migrations. Developers are encouraged to use the `php artisan schema:dump --prune` command to consolidate migrations, but this may not be straightforward for all teams, especially those with extensive migration histories[3].

6. Memory Issues

Some users have reported increased memory usage and crashes in MariaDB after upgrading to Laravel 11. This could indicate potential memory leaks or inefficiencies introduced in the new version, necessitating further investigation and possibly adjustments in server configurations[4].

7. Event Discovery and Service Providers

Laravel 11 simplifies service providers by consolidating functionality into a single `AppServiceProvider`. While this streamlining can reduce complexity, it may also require developers to adapt their understanding of service provider registration and event discovery, which were previously more modular[2].

These changes reflect Laravel's ongoing evolution but may require developers to invest time in adapting their applications and workflows to the new structure introduced in Laravel 11.

Citations:
[1] https://dev.to/tanzimibthesam/laravel-10-laravel-11-comparison-changes-2g24
[2] https://laravel.com/docs/11.x/releases
[3] https://www.reddit.com/r/PHP/comments/1cpjm0g/how_do_you_go_about_laravel_11_migration_with/
[4] https://github.com/laravel/framework/issues/50807
[5] https://github.com/laravel/framework/issues/50484