Skip to content

Commit e267b08

Browse files
half2melindyhopchris
authored andcommitted
[Doc] Fix typo in routing chapter (#458)
1 parent 23399de commit e267b08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/basics/routing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,15 @@ JsonApi::register('default')->routes(function ($api, $router) {
179179
To apply an id constraint to every resource in your API, use the `defaultId` method on the API as follows:
180180

181181
```php
182-
JsonApi::register('default')->defaultId('[\d]+')->(function ($api, $router) {
182+
JsonApi::register('default')->defaultId('[\d]+')->routes(function ($api, $router) {
183183
$api->resource('posts');
184184
});
185185
```
186186

187187
If using a default constraint for the API, you can override it for a specific resource. For example:
188188

189189
```php
190-
JsonApi::register('default')->defaultId('[\d]+')->(function ($api, $router) {
190+
JsonApi::register('default')->defaultId('[\d]+')->routes(function ($api, $router) {
191191
$api->resource('posts'); // has the default constraint
192192
$api->resource('comments')->id('[A-Z]+'); // has its own constraint
193193
$api->resource('tags')->id(null); // has no constaint

0 commit comments

Comments
 (0)