Support the ongoing development of Laravel.io →
posted 10 years ago
Packages

The package boots fine from the CLI using tinker. Running from the web, however, shows that it isn't booted even though the provided service is registered. I've checked environments and the two are saying the same thing. The simple log message doesn't always appear.

$ php artisan tinker
[2014-07-14 16:48:22] local.INFO: Booting the package [] []

The info message shows fine there. But it never gets logged when from the UI. Any idea where this could be breaking down?

bin: http://laravel.io/bin/QkzlV

Last updated 3 years ago.
0

Do you know what protected $defer = true; means/does?

Last updated 3 years ago.
0

Yes. That's for the register() method, not boot(). I rearranged the providers in config/app. It seems that the last one listed gets lost in the mix.

Last updated 3 years ago.
0

Yes. That's for the register() method, not boot().

boot() only executed after register() is called. Which again relate to the $defer value.

Last updated 3 years ago.
0

There's two types of providers, eager and deferred. When Laravel is run through the console every package is marked as an eager package even if that package is marked as deferred. This means that the register method is called for every package and then when the application is booted the boot method is also called.

During a normal Laravel run only the eager providers are registered and booted initially. Deferred providers are stored away in their own array so that when one is requested it is registered and booted.

Last updated 3 years ago.
0

Then Config::get('package::variable') isn't getting the config from the web UI. And, perhaps more importantly, this happens even if $deferred is false.

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

impleri impleri Joined 24 Mar 2014

Moderators

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

Your logo here?

Laravel.io

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

© 2025 Laravel.io - All rights reserved.