Hesto/multi-auth

different admin route

Closed this issue · 4 comments

Is there any quick way to set different admin route but keeping admin guard?

php artisan multi-auth:install admin -f

but instead of my-website.com/admin/login I want to use my-website.com/cms-name/login

Hesto commented

@ilidan86 Sure it is. Go to app/Providers/RouteServiceProvider and change method mapAdminRoutes to:

protected function mapAdminRoutes()
{
        Route::group([
            'prefix' => 'cms-name', //change
            'as' => 'cms-name.', //change
            'middleware' => ['web', 'admin','auth:admin'],
            'namespace' => $this->namespace,
        ], function ($router) {
            require base_path('routes/admin.php');
        });
}

That makes sense :) Thanks for really great work you did there! I think you saved us lots of time!

Hesto commented

Thanks appreciate it. One more thing, copy and paste the method from my previous post again because i forgot to add auth:admin middlaware to array.

Dziękuję! That worked!