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

Make route group namespaces absolute if they begin with a '\' #23066

Closed
wants to merge 1 commit into from
Closed

Make route group namespaces absolute if they begin with a '\' #23066

wants to merge 1 commit into from

Conversation

Jack97
Copy link
Contributor

@Jack97 Jack97 commented Feb 8, 2018

Currently, you can register routes to point to a fully qualified class name if it starts with a '\' - which will ignore the namespace that would otherwise be inherited from the route group stack:

Route::get('users', '\Foo\Bar\UsersController@index')

This PR adds the same functionality for route groups:

Route::namespace('\Foo\Bar')->group(function () {
    Route::get('users', 'UsersController@index'); // Foo\Bar\UsersController@index
});

@Jack97 Jack97 changed the title Make route group namespaces absolute absolute if they begin with a '\'. Make route group namespaces absolute if they begin with a '\' Feb 8, 2018
@ntzm
Copy link
Contributor

ntzm commented Feb 8, 2018

This will break existing code if a dev has leading backslashes. Should target master instead of 5.6

@taylorotwell
Copy link
Member

Indeed a breaking change.

@Jack97 Jack97 deleted the route_group_absolute_namespace branch February 10, 2018 19:02
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

Successfully merging this pull request may close these issues.

3 participants