akaunting/app/Http/Middleware/CanInstall.php

27 lines
525 B
PHP
Raw Normal View History

2017-10-22 12:51:23 +03:00
<?php
namespace App\Http\Middleware;
use Closure;
class CanInstall
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
// Check if app is installed
2017-10-23 10:16:11 +03:00
if (env('APP_INSTALLED', false) == false) {
2017-10-22 12:51:23 +03:00
return $next($request);
}
// Already installed, redirect to login
2021-04-23 11:35:25 +03:00
return redirect()->route('login');
2017-10-22 12:51:23 +03:00
}
}