@@ -14,7 +14,7 @@ Most of the time, collections are homogenous, meaning they contain a single kind
1414of resource. For example, a GET request to the ` /posts ` collection will return a
1515list of ` posts ` resources.
1616
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
1818collection for that resource type is automatically defined as well. In addition
1919to the resource's field schema and storage behaviour, you can define the
2020collection's endpoints and behaviour directly on your resource class.
@@ -26,9 +26,9 @@ information.
2626## Defining Resources
2727
2828To 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.
3232
3333``` php
3434use Tobyz\JsonApiServer\Resource\AbstractResource;
@@ -57,13 +57,13 @@ $api->resource(new PostsResource());
5757
5858When serializing a model into a JSON: API resource object, the ` getId ` method on
5959your 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:
6262
6363``` php
6464use Tobyz\JsonApiServer\Context;
6565
66- class PostsResource extends Resource
66+ class PostsResource extends AbstractResource
6767{
6868 // ...
6969
@@ -90,7 +90,7 @@ more about [field definitions](fields.md), as well as
9090use Tobyz\JsonApiServer\Schema\Field;
9191use Tobyz\JsonApiServer\Schema\Type;
9292
93- class PostsResource extends Resource
93+ class PostsResource extends AbstractResource
9494{
9595 // ...
9696
@@ -129,7 +129,7 @@ that can handle an incoming request and return a response.
129129``` php
130130use Tobyz\JsonApiServer\Endpoint;
131131
132- class UsersResource extends Resource
132+ class UsersResource extends AbstractResource
133133{
134134 // ...
135135
0 commit comments