Support the ongoing development of Laravel.io →
posted 10 years ago
Packages
Last updated 2 years ago.
0

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

Last updated 2 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 2 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 2 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 2 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 2 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.

© 2024 Laravel.io - All rights reserved.