Skip to content

Instantly share code, notes, and snippets.

@etiennemarais
Forked from mabasic/helpers.php
Created March 14, 2016 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save etiennemarais/a215001ca4f1343c1825 to your computer and use it in GitHub Desktop.
Save etiennemarais/a215001ca4f1343c1825 to your computer and use it in GitHub Desktop.
config_path function for Lumen framework
<?php
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);
}
}
@etiennemarais
Copy link
Author

Add this to lumen if you are having trouble with some laravel packages not loading the config.

Also remember to add this to your composer.json file:

"autoload": {
        ...
        "files": [
            "app/Support/helpers.php"
        ]
    },

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