blessing-skin-server/app/Http/Middleware/CheckInstallation.php
2019-12-14 11:10:37 +08:00

19 lines
410 B
PHP

<?php
namespace App\Http\Middleware;
use Illuminate\Filesystem\Filesystem;
class CheckInstallation
{
public function handle($request, \Closure $next)
{
$hasLock = resolve(Filesystem::class)->exists(storage_path('install.lock'));
if ($hasLock && !$request->is('setup/*update')) {
return response()->view('setup.locked');
}
return $next($request);
}
}