mirror of
https://github.com/alexjustesen/speedtest-tracker.git
synced 2026-06-23 06:30:08 +00:00
2c618e2d4e
* added public dashboard middleware * fixed lint issues
39 lines
1.2 KiB
PHP
39 lines
1.2 KiB
PHP
<?php
|
|
|
|
use App\Http\Middleware\PublicDashboard;
|
|
use App\Providers\AppServiceProvider;
|
|
use Illuminate\Foundation\Application;
|
|
use Illuminate\Foundation\Configuration\Exceptions;
|
|
use Illuminate\Foundation\Configuration\Middleware;
|
|
use Illuminate\Http\Request;
|
|
|
|
return Application::configure(basePath: dirname(__DIR__))
|
|
->withProviders()
|
|
->withRouting(
|
|
web: __DIR__.'/../routes/web.php',
|
|
api: __DIR__.'/../routes/api.php',
|
|
commands: __DIR__.'/../routes/console.php',
|
|
)
|
|
->withMiddleware(function (Middleware $middleware) {
|
|
$middleware->alias([
|
|
'public-dashboard' => PublicDashboard::class,
|
|
]);
|
|
|
|
$middleware->redirectGuestsTo(fn () => route('admin/login'));
|
|
$middleware->redirectUsersTo(AppServiceProvider::HOME);
|
|
|
|
$middleware->trustProxies(at: '*');
|
|
|
|
$middleware->trustProxies(headers: Request::HEADER_X_FORWARDED_FOR |
|
|
Request::HEADER_X_FORWARDED_HOST |
|
|
Request::HEADER_X_FORWARDED_PORT |
|
|
Request::HEADER_X_FORWARDED_PROTO |
|
|
Request::HEADER_X_FORWARDED_AWS_ELB
|
|
);
|
|
|
|
$middleware->throttleApi();
|
|
})
|
|
->withExceptions(function (Exceptions $exceptions) {
|
|
//
|
|
})->create();
|