public static function isDatabaseSetup()
{
try {
if (Schema::hasTable('accounts')) {
return true;
}
} catch (Exception $e) {
return false;
}
}
public function showIndex() { Session::reflash(); if (!Utils::isNinja() && (!Utils::isDatabaseSetup() || Account::count() == 0)) { return Redirect::to('/setup'); } elseif (Auth::check()) { return Redirect::to('/dashboard'); } else { return Redirect::to('/login'); } }