Description
Fortify Version
1.18.0
Laravel Version
10.16.2
PHP Version
8.2.8
Database Driver & Version
No response
Description
When there is a dot in the route name, it is not possible to customize route paths the way it is described in the default config:
Lines 20 to 42 in b5743b0
RoutePath
will get the config value for a given path with the config()
function (see below). Because of that, dots are representing config paths and each item before a dot is an array.
Line 16 in b5743b0
Instead, route paths should be declared with arrays actually:
return [
'paths' => [
'login' => null,
'logout' => null,
'password' => [
'request' => null,
'reset' => null,
'email' => null,
'update' => null,
'confirm' => null,
'confirmation' => null,
],
'register' => null,
'verification' => [
'notice' => null,
'verify' => null,
'send' => null,
],
'user-profile-information' => [
'update' => null,
],
'user-password' => [
'update' => null,
],
'two-factor' => [
'login' => null,
'enable' => null,
'confirm' => null,
'disable' => null,
'qr-code' => null,
'secret-key' => null,
'recovery-codes' => null,
]
],
];
The easiest fix is to change the default config object (and maybe the docs). But I think it would be more relevant if RoutePath::for()
would get the whole paths array with config('fortify.paths')
and then get the custom path if it exists.
Steps To Reproduce
Define a custom path for a route with a dot (for instance two-factor.login
):
// config.fortify.php
return [
'paths' => [
'two-factor.login' => '/custom/path',
],
];
Then get route list with php artisan route:list
👉 The custom path is not taken in account