Skip to content

Commit bf7b14b

Browse files
committed
Fix some class names
1 parent b34a5c2 commit bf7b14b

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

docs/collections.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ also used for defining
1010

1111
## Defining Collections
1212

13-
To define a heterogeneous collection, create a new class that implements
14-
`Tobyz\JsonApi\Resource\Collection`:
13+
To define a heterogeneous collection, create a new class that implements the
14+
`Tobyz\JsonApi\Resource\Collection` interface:
1515

1616
```php
1717
use Tobyz\JsonApiServer\Resource\Collection;

docs/resources.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Most of the time, collections are homogenous, meaning they contain a single kind
1414
of resource. For example, a GET request to the `/posts` collection will return a
1515
list 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
1818
collection for that resource type is automatically defined as well. In addition
1919
to the resource's field schema and storage behaviour, you can define the
2020
collection's endpoints and behaviour directly on your resource class.
@@ -26,9 +26,9 @@ information.
2626
## Defining Resources
2727

2828
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.
3232

3333
```php
3434
use Tobyz\JsonApiServer\Resource\AbstractResource;
@@ -57,13 +57,13 @@ $api->resource(new PostsResource());
5757

5858
When serializing a model into a JSON:API resource object, the `getId` method on
5959
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:
6262

6363
```php
6464
use 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
9090
use Tobyz\JsonApiServer\Schema\Field;
9191
use 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
130130
use Tobyz\JsonApiServer\Endpoint;
131131

132-
class UsersResource extends Resource
132+
class UsersResource extends AbstractResource
133133
{
134134
// ...
135135

0 commit comments

Comments
 (0)