Skip to content

Commit

Permalink
#198 - rewiring middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofrewak committed Mar 27, 2024
1 parent 2a7b97f commit a096d29
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
declare(strict_types=1);

use CodeZero\LocalizedRoutes\Controllers\FallbackController;
use CodeZero\LocalizedRoutes\Middleware\SetLocale;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Support\Facades\Route;

return Application::configure(basePath: dirname(__DIR__))
Expand All @@ -21,6 +24,13 @@
Route::fallback(FallbackController::class);
},
)
->withMiddleware()
->withMiddleware(function (Middleware $middleware): void {
$middleware->web(remove: [
SubstituteBindings::class,
])->web(append: [
SetLocale::class,
SubstituteBindings::class,
]);
})
->withExceptions()
->create();

0 comments on commit a096d29

Please sign in to comment.