Skip to content

Route Groups

Joshua Parker edited this page Aug 21, 2020 · 3 revisions

It is common to group similar routes behind a common prefix. This can be achieved using Route Groups:

$router->group(['prefix' => 'page'], function ($group) {
    $group->map(['GET'], 'route1', function () {}); // `/page/route1`
    $group->map(['GET'], 'route2', function () {}); // `/page/route2§`
});
Clone this wiki locally