Skip to content

7. Grouping

İzni Burak Demirtaş edited this page Nov 22, 2020 · 2 revisions

If you want you can group the routes you create.

Example:

$router->group('admin', function($router) {
    $router->get('foo', function() {
        return 'page: admin/foo';
    });

    $router->post('bar', function() {
        return 'page: admin/bar';
    });
});

# Created Routes:
/*
- GET /admin/foo
- POST /admin/bar
*/

Also, you can use nested group routes.

Clone this wiki locally