mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-17 21:49:01 +01:00
Improved the AppIsSetup middleware
This commit is contained in:
parent
7e5ec12c05
commit
d2d605e884
@ -11,7 +11,7 @@
|
||||
|
||||
namespace CachetHQ\Cachet\Http\Middleware;
|
||||
|
||||
use CachetHQ\Cachet\Models\Setting;
|
||||
use CachetHQ\Cachet\Facades\Setting;
|
||||
use Closure;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
@ -31,13 +31,8 @@ class AppIsSetup
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
try {
|
||||
$setting = Setting::where('name', 'app_name')->first();
|
||||
if ($setting && $setting->value) {
|
||||
return Redirect::route('dashboard');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
// do nothing
|
||||
if (Setting::get('app_name')) {
|
||||
return Redirect::to('dashboard');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
|
Loading…
x
Reference in New Issue
Block a user