CaiWuXiTong/app/Http/Middleware/RedirectIfNotInstalled.php
WuYongJie 9595267ee7
Some checks failed
Tests / PHP 8.1 (push) Has been cancelled
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
chore: 导入 Akaunting 初始源码与团队协作规则
2026-07-20 18:20:25 +08:00

32 lines
706 B
PHP

<?php
namespace App\Http\Middleware;
use Closure;
class RedirectIfNotInstalled
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
// Check application is installed or not
if (config('app.installed', false) == true) {
return $next($request);
}
// Already in the installation wizard
if ($request->isInstall()) {
return $next($request);
}
// Not installed, redirect to installation wizard
return redirect()->route('install.requirements');
}
}