2025-09-13 17:39:17 +03:00
|
|
|
<?php
|
|
|
|
|
|
2025-09-20 16:47:41 +03:00
|
|
|
use App\Http\Middleware\GoatCounterMiddleware;
|
2026-03-29 16:14:18 +03:00
|
|
|
use App\Http\Middleware\IsAdmin;
|
2025-09-13 17:39:17 +03:00
|
|
|
use Illuminate\Foundation\Application;
|
|
|
|
|
use Illuminate\Foundation\Configuration\Exceptions;
|
|
|
|
|
use Illuminate\Foundation\Configuration\Middleware;
|
|
|
|
|
|
|
|
|
|
return Application::configure(basePath: dirname(__DIR__))
|
|
|
|
|
->withRouting(
|
|
|
|
|
web: __DIR__.'/../routes/web.php',
|
|
|
|
|
api: __DIR__.'/../routes/api.php',
|
|
|
|
|
commands: __DIR__.'/../routes/console.php',
|
|
|
|
|
health: '/up',
|
|
|
|
|
)
|
|
|
|
|
->withMiddleware(function (Middleware $middleware): void {
|
2025-09-20 16:47:41 +03:00
|
|
|
$middleware->append(GoatCounterMiddleware::class);
|
2026-03-29 16:14:18 +03:00
|
|
|
$middleware->alias([
|
|
|
|
|
'admin' => IsAdmin::class,
|
|
|
|
|
]);
|
2025-09-13 17:39:17 +03:00
|
|
|
})
|
|
|
|
|
->withExceptions(function (Exceptions $exceptions): void {
|
|
|
|
|
//
|
|
|
|
|
})->create();
|