Welcome Guest, Not a member yet? Register   Sign In
route group, only first one works
#1

(This post was last modified: 01-25-2023, 05:50 AM by sjender.)

I am trying to group my routes in order to improve the readability.
But if I add a group, only the first one in the group seems to work.

PHP Code:
$routes->group('cms', static function ($routes) {
    $routes->get('/', [Dashboard::class, 'index']);
    $routes->get('/login', [Authentication::class, 'login']);
});

//$routes->get('/cms/', [Dashboard::class, 'index']);
//$routes->get('/cms/login', [Authentication::class, 'login']); 

When I un-escape the original routes, all works well, but in the group only /cms works.
Am I expecting something other than designed?
https://site/cms/login ends up with:
Code:
404 - File Not Found
Can't find a route for 'get: cms/login'.
Reply


Messages In This Thread
route group, only first one works - by sjender - 01-25-2023, 05:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB