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

[5.4] Allow route groups to be loaded from a file directly #16707

Merged
merged 1 commit into from
Dec 8, 2016

Conversation

JosephSilber
Copy link
Member

Since keeping the route definitions for each group in its own file is a common pattern, this PR allows the file path to be passed directly to the group method on the router.


Will convert this:

Route::prefix('api')
     ->middleware('api|auth:api')
     ->namespace($this->namespace)
     ->group(function ($router) {
         require base_path('routes/api.php');
     });

into this:

Route::prefix('api')
     ->middleware('api|auth:api')
     ->namespace($this->namespace)
     ->group(base_path('routes/api.php'));

This is another attempt at #14572

@taylorotwell taylorotwell merged commit b7f6112 into laravel:master Dec 8, 2016
@JosephSilber JosephSilber deleted the route-group-path branch December 9, 2016 02:03
@CristianLlanos
Copy link

Nice one, @JosephSilber. Thanks 👍

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