@@ -14,7 +14,7 @@ Most of the time, collections are homogenous, meaning they contain a single kind
14
14
of resource. For example, a GET request to the ` /posts ` collection will return a
15
15
list of ` posts ` resources.
16
16
17
- When you define a resource type by extending the base ` Resource ` class, a
17
+ When you define a resource type by extending the ` AbstractResource ` class, a
18
18
collection for that resource type is automatically defined as well. In addition
19
19
to the resource's field schema and storage behaviour, you can define the
20
20
collection's endpoints and behaviour directly on your resource class.
@@ -26,9 +26,9 @@ information.
26
26
## Defining Resources
27
27
28
28
To define a resource type within your API, create a new class that extends
29
- ` Tobyz\JsonApi\Resource\Resource ` , and implement the ` type() ` method to return
30
- the name of your resource type. This will also be used as the collection path
31
- for your resource.
29
+ ` Tobyz\JsonApi\Resource\AbstractResource ` , and implement the ` type() ` method to
30
+ return the name of your resource type. This will also be used as the collection
31
+ path for your resource.
32
32
33
33
``` php
34
34
use Tobyz\JsonApiServer\Resource\AbstractResource;
@@ -57,13 +57,13 @@ $api->resource(new PostsResource());
57
57
58
58
When serializing a model into a JSON: API resource object, the ` getId ` method on
59
59
your resource class will be used to get the ` id ` for the model. A default
60
- implementation is provided in the ` Resource ` class which assumes that your
61
- models have an ` id ` property. You may override this if needed:
60
+ implementation is provided in the ` AbstractResource ` class which assumes that
61
+ your models have an ` id ` property. You may override this if needed:
62
62
63
63
``` php
64
64
use Tobyz\JsonApiServer\Context;
65
65
66
- class PostsResource extends Resource
66
+ class PostsResource extends AbstractResource
67
67
{
68
68
// ...
69
69
@@ -90,7 +90,7 @@ more about [field definitions](fields.md), as well as
90
90
use Tobyz\JsonApiServer\Schema\Field;
91
91
use Tobyz\JsonApiServer\Schema\Type;
92
92
93
- class PostsResource extends Resource
93
+ class PostsResource extends AbstractResource
94
94
{
95
95
// ...
96
96
@@ -129,7 +129,7 @@ that can handle an incoming request and return a response.
129
129
``` php
130
130
use Tobyz\JsonApiServer\Endpoint;
131
131
132
- class UsersResource extends Resource
132
+ class UsersResource extends AbstractResource
133
133
{
134
134
// ...
135
135
0 commit comments