5

Hi I'm building a Laravel 5 project that is to be deployed in a subfolder on a server inside a wordpress application(I don't know why but clients are clients), then I need to prefix all the routes from the application with a prefix like "/es", now the issue is with Auth related routes. In my routes definitions I have the following line:

Route::controllers([
    'auth' => 'Auth\AuthController',
    'password' => 'Auth\PasswordController',
]);

And my question is, is there any way to prefix this routes without having to put all route definitions for the auth controller extracted from the trait that handles them?

Thanks in advance.

3
  • Have you seen this? laravel.com/docs/5.1/routing#route-group-prefixes Commented Dec 19, 2015 at 18:30
  • Yes, I have created a Route::group that contains the definition of the Auth and Password controllers, but no luck with that. Commented Dec 19, 2015 at 18:37
  • 1
    Sorry, your comment made a solution for, I have already tested it but the prefix had a typo, then there was no way to make it work. Please turn this coment into an answer to mark it correct. Commented Dec 19, 2015 at 18:47

2 Answers 2

2

You can use a Route Prefix: http://laravel.com/docs/5.1/routing#route-group-prefixes

The prefix group array attribute may be used to prefix each route in the group with a given URI.

Sign up to request clarification or add additional context in comments.

Comments

0

You should probably for this route simply change auth and password to have prefix:

Route::controllers([
    'es/auth' => 'Auth\AuthController',
    'es/password' => 'Auth\PasswordController',
]);

If it doesn't help please provide detailed description what exactly doesn't work

1 Comment

It just does not work, If I do that then when accessing to the right url will throw a 404 error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.