Adding routes to group doesn't work #259
Unanswered
sammyskills
asked this question in
Q&A
Replies: 2 comments 11 replies
-
There are route definitions as an array in the Config class: |
Beta Was this translation helpful? Give feedback.
0 replies
-
This patch solves this problem. --- a/src/Auth.php
+++ b/src/Auth.php
@@ -102,7 +102,7 @@ public function routes(RouteCollection &$routes, array $config = []): void
{
$authRoutes = config('AuthRoutes')->routes;
- $routes->group('/', ['namespace' => 'CodeIgniter\Shield\Controllers'], static function (RouteCollection $routes) use ($authRoutes, $config): void {
+ $routes->group('', ['namespace' => 'CodeIgniter\Shield\Controllers'], static function (RouteCollection $routes) use ($authRoutes, $config): void {
foreach ($authRoutes as $name => $row) {
if (! isset($config['except']) || (isset($config['except']) && ! in_array($name, $config['except'], true))) {
foreach ($row as $params) { |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I've tried to change the default route by grouping it like so:
But it doesn't work as expected, visiting
account/login
ORaccount/register
, returns a 404 error and when I runphp spark routes
command, it shows:account///login
account///register
I understand that from the docs, it is possible to customize the routes, but what if I just want to put all the routes in a group, without having to do that for all individual routes?
Beta Was this translation helpful? Give feedback.
All reactions