add extra 'admin' prefix in admin routes in laravel 8

57 Views Asked by At

I have created some routes in Laravel using Route::methods and also resources but some admin and non-admin routes add extra 'admin' prefix in routes.

So when I am calling the routes it does not work without adding an extra prefix like "admin/admin/profile"

My some findings

  1. I have already checked any double prefix is not added in the routes.
  2. And Also check with php artisan route: list. It would show the correct route list without any extra prefixes.
1

There are 1 best solutions below

1
rain developer On

Answer

Check below thing i think this will help you.

  1. I think you have a middleware group that is applying the prefix to all routes.
  2. You have a route group that is applying the prefix to all routes inside of it.
  3. or a custom route generator that is adding the prefix to all routes.

-> If you still having problem then you can check your all rout list by below command

php artisan route:list

-> Or you can use to check uri by current()->uri() function to get current URI

-> I hope this is help you.