You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/routing.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
To define the routes available in an API, register the API in your `routes/api.php` file as follows:
6
6
7
7
```php
8
-
JsonApi::api('default', ['as' => 'api.'], function ($api, $router) {
8
+
JsonApi::api('default', ['namespace' => 'Api'], function ($api, $router) {
9
9
$api->resource('posts');
10
10
$api->resource('comments');
11
11
});
@@ -21,12 +21,12 @@ the service container instead.
21
21
22
22
## Controller
23
23
24
-
By default, routing will assume that the controller for a resource type is the resource type name suffixed with `Controller`. E.g. for a `posts` resource type, the controller will be `PostsController`. The options array to the `JsonApi::api` method takes the same options as a route group, so you can set the namespace using the `namespace` option.
24
+
By default, routing will assume that the controller for a resource type is the resource type name suffixed with `Controller`. E.g. for a `posts` resource type, the controller will be `PostsController`. The options array to the `JsonApi::register` method takes the same options as a route group, so you can set the namespace using the `namespace` option.
25
25
26
26
If you need to override the default name for a resource type's controller, use the `controller` option as follows:
0 commit comments