fixed #57
This commit is contained in:
26
app/Http/Middleware/CanInstall.php
Normal file
26
app/Http/Middleware/CanInstall.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user