Laravel\Lumen\Application::getConfigurationPath PHP Method

getConfigurationPath() public method

If no name is provided, then we'll return the path to the config folder.
public getConfigurationPath ( string | null $name = null ) : string
$name string | null
return string
    public function getConfigurationPath($name = null)
    {
        if (!$name) {
            $appConfigDir = $this->basePath('config') . '/';
            if (file_exists($appConfigDir)) {
                return $appConfigDir;
            } elseif (file_exists($path = __DIR__ . '/../config/')) {
                return $path;
            }
        } else {
            $appConfigPath = $this->basePath('config') . '/' . $name . '.php';
            if (file_exists($appConfigPath)) {
                return $appConfigPath;
            } elseif (file_exists($path = __DIR__ . '/../config/' . $name . '.php')) {
                return $path;
            }
        }
    }

Usage Example

 /**
  * Get the path to the given configuration file.
  * 
  * If no name is provided, then we'll return the path to the config folder.
  *
  * @param string|null $name
  * @return string 
  * @static 
  */
 public static function getConfigurationPath($name = null)
 {
     return \Laravel\Lumen\Application::getConfigurationPath($name);
 }