Support the ongoing development of →
Installation Configuration Packages
Last updated 2 years ago.

It doesn't matter where you place your provider class. As long as it extents Illuminate\Support\ServiceProvider and is defined in the config/app.php Laravel will treat it as a provider. The reason we define a provider and register everything there is because we don't have to write a lot.

For example its easier to use $this->app->singleton to register a class rather than defining the singleton construct in the class itself. You can also register any events, configuration, migrations, etc on the service provider class saving a lot of unnecessary coding.

Last updated 9 years ago.

Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.