feat: implement admin authentication
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Middleware\AdminAuth;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Foundation\Configuration\Exceptions;
|
||||
use Illuminate\Foundation\Configuration\Middleware;
|
||||
@@ -10,12 +11,17 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
__DIR__.'/../routes/web.php',
|
||||
__DIR__.'/../routes/auth.php',
|
||||
__DIR__.'/../routes/dashboard.php',
|
||||
__DIR__.'/../routes/admins.php',
|
||||
],
|
||||
|
||||
commands: __DIR__.'/../routes/console.php',
|
||||
health: '/up',
|
||||
)
|
||||
->withMiddleware(function (Middleware $middleware) {
|
||||
$middleware->redirectGuestsTo(fn(Request $request)=>route('auth.login.index'));
|
||||
$middleware->alias([
|
||||
'admin.auth' => AdminAuth::class,
|
||||
]);
|
||||
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions) {
|
||||
|
||||
Reference in New Issue
Block a user