Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mbachmann's avatar

ServiceProvider reason to use both register() and boot() in the same Provider

I tried to understand the Laravel ServiceProviders and after reading the documentation https://laravel.com/docs/5.5/providers and watching the following laracast https://laracasts.com/lessons/service-providers-decoded I still have a question.

I can't think about an example where I would use the register() and boot() method in the same ServiceProviderClass. I've got the feeling the methods have completely different Use Cases. Can someone help me out with this, I feel like I'm missing an important point here.

0 likes
0 replies

Please or to participate in this conversation.