From b22996bb6d0cb2cf7b9e0da6f715aa0da5d4b46d Mon Sep 17 00:00:00 2001 From: Mark Gregory Date: Fri, 19 Jun 2026 13:22:52 +0100 Subject: [PATCH] fully working tests --- bootstrap/app.php | 14 +++++++------- routes/web.php | 3 +-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/bootstrap/app.php b/bootstrap/app.php index 37457e4c..6acce3b5 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -4,6 +4,7 @@ use Illuminate\Foundation\Application; use Illuminate\Foundation\Configuration\Exceptions; use Illuminate\Foundation\Configuration\Middleware; use Illuminate\Http\Request; +use Modules\Platform\app\Http\Middleware\EnsureLicensedTenant; return Application::configure(basePath: dirname(__DIR__)) ->withRouting( @@ -12,24 +13,23 @@ return Application::configure(basePath: dirname(__DIR__)) health: '/up', ) ->withMiddleware(function (Middleware $middleware): void { - $middleware->trustProxies( - at: '*', - headers: Request::HEADER_X_FORWARDED_FOR - | Request::HEADER_X_FORWARDED_HOST - | Request::HEADER_X_FORWARDED_PORT - | Request::HEADER_X_FORWARDED_PROTO - ); + + $middleware->alias([ + 'company.licensed' => EnsureLicensedTenant::class, + ]); + $environment = $_ENV['APP_ENV'] ?? $_SERVER['APP_ENV'] ?? getenv('APP_ENV') ?: null; + if ($environment === 'testing') { $middleware->validateCsrfTokens(except: ['*']); } diff --git a/routes/web.php b/routes/web.php index 0697f1c1..ecee1571 100644 --- a/routes/web.php +++ b/routes/web.php @@ -11,7 +11,7 @@ Route::get('/', function () { })->name('home'); Route::get('/dashboard', PlatformDashboardController::class) - ->middleware(['auth']) + ->middleware(['auth', 'verified', 'company.licensed']) ->name('dashboard'); require __DIR__.'/settings.php'; @@ -74,4 +74,3 @@ Route::get('/api/countries/{code}/subdivisions', function (string $code) { return response()->json(['data' => $subdivisions]); })->name('countries.api.subdivisions.compat'); -