Extra Config Settings for Lumen

Extra Config Settings for Lumen

In Lumen there's no config directory. This is to keep the framework as light as possible.

However there are times when you need to add a few settings of your own. Actually this is really quick and easy.

In your .env file put the new setting that you need



Make a new directory under the app directory and call it "config". Inside make a new file and call it what you like, eg: extra_config.php

In that file put an array like this with your own config names. Note: You can put a default value to be used if the .env file setting is not set.



return [

    'custom_setting' => env('APP_NEW_CONFIG', 'default'),


Finally tell Lumen what you have done!

Open the bootstrap/app.php and put




Put it after this

$app = new Laravel\Lumen\Application(

But before this

return $app;


Then you just use it the same way you do in Laravel