Reputation: 2530
I'm trying out the PHP micro Framework Lumen (from laravel).
When I set up Lumen and I try to use the php artisan config:cache
command like in Laravel, I get this error :
[InvalidArgumentException]
There are no commands defined in the "config" namespace.
So I have problem when I try to deploy the files to server, so I have to change .env
file to change the database username and password.
This makes me think config
is not available in artisan
How can I add it to artisan ?
Upvotes: 9
Views: 31338
Reputation: 18883
Lumen no need to config:cache
.
You do not need to do anything after change .env
Upvotes: 1
Reputation: 548
In lumen
you have to add this configuration in bootstrap/app.php
file
$app->configure('custom_config_file_name');
#example
$app->configure('custom_emails');
Then you can access like below:
config('filename.key_name');
#example
config('constants.email');
Upvotes: 3
Reputation: 3594
Yes, you can not use the php artisan config:cache with your Lumen project, because it is not available out of the box.
You can add it by adding this package (orumad/lumen-config-cache) to your project:
composer require orumad/lumen-config-cache
Upvotes: 4