Skip to content

Instantly share code, notes, and snippets.

Last active October 27, 2022 16:52
  • Star 68 You must be signed in to star a gist
  • Fork 16 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
config_path function for Lumen framework
if ( ! function_exists('config_path'))
* Get the configuration path.
* @param string $path
* @return string
function config_path($path = '')
return app()->basePath() . '/config' . ($path ? '/' . $path : $path);


Create a file called helpers.php in the app/ directory. Paste the code inside it.

Go to composer.json and add files to autoload so that it looks like this:

"autoload": {
    "psr-4": {
        "App\\": "app/"
    "files": [

Run composer dump-autoload to load the newly created helpers file.

Copy link

alekaka commented Feb 18, 2022

Thank you

Copy link

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment