akaunting/app/Http/Middleware/CanInstall.php
2017-10-23 10:16:11 +03:00

27 lines
522 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', false) == false) {
return $next($request);
}
// Already installed, redirect to login
redirect('auth/login')->send();
}
}