Skip to content

Commit ded8c19

Browse files
committed
docs: add docs for prefix option in authentication routes
1 parent 9efef88 commit ded8c19

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

docs/customization/route_config.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ service('auth')->routes($routes, ['namespace' => '\App\Controllers\Auth']);
2929

3030
This will generate the routes with the specified namespace instead of the default Shield namespace. This can be combined with any other options, like `except`.
3131

32+
## Change Prefix
33+
34+
If you wish, you can prefix all defined authentication routes using the `prefix` option. This is particularly useful if you want all your routes to be under the same root (for example, `auth/login`, `auth/register`).
35+
36+
```php
37+
service('auth')->routes($routes, ['prefix' => 'auth']);
38+
```
39+
40+
This generates routes whose paths are all prefixed with `auth`.
41+
3242
## Use Locale Routes
3343

3444
You can use the `{locale}` placeholder in your routes

0 commit comments

Comments
 (0)