Initial Commit
tests / ci (push) Canceled after 0s

This commit is contained in:
Mark Gregory
2026-10-15 17:24:49 +01:00
parent 48a95478ef
commit 23de49aae0
27 changed files with 946 additions and 26 deletions
+20
View File
@@ -0,0 +1,20 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class EnsureLodgeAdmin
{
public function handle(Request $request, Closure $next): Response
{
$admin = trim((string) config('lodge.admin_email', ''));
$email = trim((string) $request->user()?->email);
abort_unless($admin !== '' && $email !== '' && strcasecmp($admin, $email) === 0, 403);
return $next($request);
}
}