public function install($locale)
{
if (!Laralum::checkInstalled()) {
$exitCode = Artisan::call('migrate');
if (Auth::attempt(['email' => env('USER_EMAIL'), 'password' => env('USER_PASSWORD')])) {
// Authentication passed...
$file_location = base_path() . '/.env';
$default = "\nLARALUM_INSTALLED=true";
file_put_contents($file_location, $default, FILE_APPEND);
$url = route('Laralum::dashboard');
return redirect()->intended($url)->with('success', trans('laralum.welcome_to_laralum'));
} else {
die("<b>ERROR: </b> Something went wrong, please post an issue about it on github");
}
} else {
return redirect()->route('Laralum::dashboard')->with('warning', trans('laralum.already_installed'));
}
}