update project

This commit is contained in:
root
2026-05-30 01:11:35 -04:00
parent 3a0628ecc7
commit 2225f6bc72
9743 changed files with 1122482 additions and 59 deletions
@@ -0,0 +1,26 @@
<?php declare(strict_types=1);
namespace App\Http\Middleware;
use App\Domain\SchoolCore\Context\SchoolContext;
use App\Domain\SchoolCore\Context\SchoolContextStore;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
final class EnsureDomainProfile
{
public function __construct(private readonly SchoolContextStore $store) {}
public function handle(Request $request, Closure $next, string $profile): Response
{
/** @var SchoolContext|null $context */
$context = $request->attributes->get(SchoolContext::class) ?? $this->store->current();
if (! $context || $context->domainProfile !== $profile) {
abort(403, 'This route is not available for the current school domain profile.');
}
return $next($request);
}
}