Skip to content

Commit

Permalink
Move http kernel stuff to app
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Snow committed Feb 1, 2025
1 parent e84a742 commit 05b150e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 70 deletions.
69 changes: 0 additions & 69 deletions app/Http/Kernel.php

This file was deleted.

15 changes: 14 additions & 1 deletion bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,24 @@
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) {
//
// API middleware group
$middleware->group('api', [
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
// \Illuminate\Routing\Middleware\ThrottleRequests::class.':api',
\Specialtactics\L5Api\Http\Middleware\SnakeCaseInputParameterKeys::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
]);

// Aliases
$middleware->alias([
'snake_case' => \Specialtactics\L5Api\Http\Middleware\SnakeCaseInputParameterKeys::class,
'check_role' => \Specialtactics\L5Api\Http\Middleware\CheckUserRole::class,
]);
})
->withExceptions(function (Exceptions $exceptions) {
//
Expand Down
1 change: 1 addition & 0 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Dingo\Api\Routing\Router;
use Illuminate\Http\Request;
use Specialtactics\L5Api\Http\Middleware\CheckUserRole;

/*
|--------------------------------------------------------------------------
Expand Down

0 comments on commit 05b150e

Please sign in to comment.