Alexander Lomia Alexander Lomia - 1 year ago 270
PHP Question

How to add custom config file to app/config in Laravel 5?

I want to add

to app/config directory of my Laravel 5 project, but can't find any article explaining this process. How is this done?

Answer Source

You can easily add a new file to the config folder. This file should return configuration values. Check other config files for reference. Say constants.php is like so


return array(
    'pagination' => array(
           'items_per_page' => 10

You can now access this config file from anywhere by either using the Config Facade or the config() global function like so





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download