feat: implement routes for panel admin

This commit is contained in:
2026-08-18 17:59:03 -07:00
parent c80c9c5e2b
commit ebec702aff
3 changed files with 46 additions and 74 deletions
+18 -2
View File
@@ -10,13 +10,29 @@ return Application::configure(basePath: dirname(__DIR__))
web: [
__DIR__ . '/../routes/web.php',
__DIR__ . '/../routes/auth.php',
__DIR__ . '/../routes/admin.php',
],
commands: __DIR__.'/../routes/console.php',
commands: __DIR__ . '/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware): void {
$middleware
->redirectGuestsTo(fn(Request $request)=> route('auth.login.index'));
->redirectGuestsTo(function (Request $request) {
if ($request->routeIs('admin.*')) {
return route('admin.auth.login.index');
}
return route('auth.login.index');
})
->redirectUsersTo(function (Request $request) {
if ($request->routeIs('admin.*')) {
return route(name: 'admin.dashboard.index');
}
return route(name: 'index');
});
})
->withExceptions(function (Exceptions $exceptions): void {
//