private function getFileByEnvironment($filename)
{
// set path to published config location
$path = config_path() . '/devise';
if (!$this->files->isDirectory($path)) {
$this->files->makeDirectory($path, 0755, true);
}
$file = $path . "/{$filename}.php";
if ($this->files->isDirectory($path)) {
return $file;
}
throw new \Exception($path . ' is not a directory');
}