akaunting/app/Http/Middleware/CanInstall.php
2017-10-22 12:51:23 +03:00

27 lines
521 B
PHP

<?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
if (env('APP_INSTALLED', true) == false) {
return $next($request);
}
// Already installed, redirect to login
redirect('auth/login')->send();
}
}