Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

different admin route #20

Closed
ilidan85 opened this issue Oct 18, 2016 · 4 comments
Closed

different admin route #20

ilidan85 opened this issue Oct 18, 2016 · 4 comments

Comments

@ilidan85
Copy link

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
Copy link
Owner

Hesto commented Oct 18, 2016

@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');
        });
}

@ilidan85
Copy link
Author

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

@Hesto
Copy link
Owner

Hesto commented Oct 19, 2016

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.

@ilidan85
Copy link
Author

Dziękuję! That worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants