fully working tests
This commit is contained in:
+7
-7
@@ -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: ['*']);
|
||||
}
|
||||
|
||||
+1
-2
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user