config/app.php providers array #6
Comments
Isn't this the expected behavior? Can you elaborate? |
Old discussion on the same topic, the idea is that you don't want to replicate/maintain the entire providers array in 2 places. You only want to add the dev providers for the local environment. |
Thanks @DeverStyle, I get it now. So apparently you can work around with |
It looks like here for app.providers the arrays are 0 indexed so the local providers would replace existing production providers instead of appending. |
Well actually I've done a quick check, and it seems
|
[0] => funny instead of 'Illuminate\Foundation\Providers\ArtisanServiceProvider', it works with append_config |
Oh oh. Yeah I saw it. Let me try again. |
Alright, here you go:
yields
So I guess, |
yes, you could update the readme to point people in the right direction. |
Great idea @DeverStyle. Will do in a minute. |
The append_config fix didn't work for me, I got it working as described here by creating a LocalServiceProvider and registering dev providers in there. |
There is a typo in my original comment. It should say: It appears that the providers array in Sorry for the confusion. |
Then I can say I can't replicate that. See above for the discussion between @DeverStyle and me. Do you think you can provide more info? |
Since cascading-config is a provider itself, you have to (re)register the missing providers after the current ones are registered. What you could do, is extend the Illuminate\Foundation\Application and add a new method: public function registerMissingConfiguredProviders() {
$this->afterBootstrapping('Illuminate\Foundation\Bootstrap\RegisterProviders', function($app) {
$app->registerConfiguredProviders();
});
} And add a call to this new method in it's __construct public function __construct($basePath = null)
{
parent::__construct($basePath);
$this->registerMissingConfiguredProviders();
} Since $app->register does a check for already loaded providers, i believe it doesn't causes a lot of extra overhead. |
It appears that the providers array in
config/app.php
CAN NOT be overridden in something likeconfig.local/app.php
. Is there a way around this? What other config data cannot be changed using cascading config?The text was updated successfully, but these errors were encountered: