Replies: 2 comments 2 replies
-
In Laravel 11.x, the structure of the application has been updated, and certain configurations have been moved to different locations compared to Laravel 10.x. If you want to remove or modify default service providers in Laravel 11.x without directly editing the Here's how you can achieve this:
By following these steps, you can customize the loading of service providers in Laravel 11.x without directly modifying the |
Beta Was this translation helpful? Give feedback.
-
Remove default ServiceProviders// config/app.php
use Illuminate\Support\ServiceProvider;
'providers' => ServiceProvider::defaultProviders()->except([
Illuminate\Foo\FooServiceProvider::class,
])->toArray(), Replace// config/app.php
use Illuminate\Support\ServiceProvider;
'providers' => ServiceProvider::defaultProviders()->replace([
Illuminate\Foo\FooServiceProvider::class => Bar\BarServiceProvider::class,
])->toArray(),
|
Beta Was this translation helpful? Give feedback.
-
At 10.x we can just remove providers by comment the lines in app.php,
while 10.x also moved default providers to vendors. So that we can continue copy it out to app.php then remove something.
How can we do it in 11.x?
Just like #50500 , I don't think there will be no one creates a new laravel project.
Btw, if someone who can resolve the issue of #50500 is better, thanks a lot.
Beta Was this translation helpful? Give feedback.
All reactions