<?php
 namespace App\Http\Middleware; use App\Services\Install\InstallService; use Closure; use Illuminate\Http\Request; class EnsureInstalled { public function __construct(private readonly InstallService $install) { } public function handle(Request $request, Closure $next) { if ($this->install->isInstalled() || app()->environment('local', 'testing') || $request->is('install', 'install/*')) { return $next($request); } return redirect('/install'); } } 