0

Can i do something like Symfony to associate a route to a package? So every route on my routes.php admin package are prefixed with '/admin/'?

Because actually i can put a route on my main routes.php like '/admin' and i can put the same on my package routes without knowing that on my main routes this route is already in use.

My current package routes.php is something like this:

Route::get('/admin', 'MyVendor\administration\AdminController@test');

But what happens if i put the same '/admin' on the main routes? i dont like this approach.

Sorry for my English, i hope you understand me.

Thank you

4

1 に答える 1

1

はい、できます(laravelサイトから)

Route::group(array('prefix' => 'admin'), function()
{
    Route::get('user', function()
    {
        //
    });
});

ルートのプレフィックスに関するドキュメントとこの回答も読んでください。

于 2013-10-01T16:01:47.753 に答える