Skip to content

Commit ab5bd65

Browse files
committed
Merge branch 'release/5.0.0'
2 parents d983f29 + 8c4ad72 commit ab5bd65

File tree

422 files changed

+5478
-1748
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

422 files changed

+5478
-1748
lines changed

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,22 @@
33
All notable changes to this project will be documented in this file. This project adheres to
44
[Semantic Versioning](http://semver.org/) and [this changelog format](http://keepachangelog.com/).
55

6-
## [4.1.0] - 2023-01-19
6+
## [5.0.0] - 2023-01-21
7+
8+
### Changed
9+
10+
- Drop support for PHP `7.4` - minimum PHP version is now `8.0`.
11+
- Drop support for Laravel 8 - package requires Laravel 9.
12+
13+
## [5.0.0-alpha.1] - 2022-06-25
14+
15+
### Changed
16+
17+
- **BREAKING** Upgraded the `neomerx/json-api` dependency from `v1` to `v5` of our fork
18+
`laravel-json-api/neomerx-json-api`. Refer to the [Upgrade Guide](./docs/upgrade.md) for details of the required
19+
changes.
20+
21+
## [4.1.0] - 2023-01-21
722

823
### Changed
924

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
"require": {
2525
"php": "^8.0",
2626
"ext-json": "*",
27-
"laravel-json-api/neomerx-json-api": "^1.2",
27+
"laravel-json-api/neomerx-json-api": "^5.0.1",
2828
"laravel/framework": "^9.0",
2929
"nyholm/psr7": "^1.2",
30-
"ramsey/uuid": "^3.0|^4.0",
30+
"ramsey/uuid": "^4.0",
3131
"symfony/psr-http-message-bridge": "^2.0"
3232
},
3333
"require-dev": {
@@ -61,7 +61,7 @@
6161
},
6262
"extra": {
6363
"branch-alias": {
64-
"dev-develop": "4.x-dev"
64+
"dev-develop": "5.x-dev"
6565
},
6666
"laravel": {
6767
"providers": [

database/migrations/2018_10_23_000001_create_client_jobs_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/*
3-
* Copyright 2022 Cloud Creativity Limited
3+
* Copyright 2023 Cloud Creativity Limited
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

docs/basics/adapters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,9 @@ For example, this would create the following for a `posts` resource:
582582
namespace App\JsonApi\Posts;
583583

584584
use CloudCreativity\LaravelJsonApi\Adapter\AbstractResourceAdapter;
585+
use CloudCreativity\LaravelJsonApi\Contracts\Http\Query\QueryParametersInterface;
585586
use CloudCreativity\LaravelJsonApi\Document\ResourceObject;
586587
use Illuminate\Support\Collection;
587-
use Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface;
588588

589589
class DummyClass extends AbstractResourceAdapter
590590
{
@@ -624,7 +624,7 @@ class DummyClass extends AbstractResourceAdapter
624624
/**
625625
* @inheritDoc
626626
*/
627-
public function query(EncodingParametersInterface $parameters)
627+
public function query(QueryParametersInterface $parameters)
628628
{
629629
// TODO: Implement query() method.
630630
}

docs/basics/schemas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ can locate a schema for each PHP class it encounters.
3535
## Creating Schemas
3636

3737
To generate a schema that extends, use the following command. The generated schema will extend
38-
`Neomerx\JsonApi\Schema\SchemaProvider`.
38+
`CloudCreativity\LaravelJsonApi\Schema\SchemaProvider`.
3939

4040
```bash
4141
php artisan make:json-api:schema <resource-type> [<api>]

docs/features/async.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ In the generated schema, you will need to add the `AsyncSchema` trait, for examp
7171

7272
```php
7373
use CloudCreativity\LaravelJsonApi\Queue\AsyncSchema;
74-
use Neomerx\JsonApi\Schema\SchemaProvider;
74+
use CloudCreativity\LaravelJsonApi\Schema\SchemaProvider;
7575

7676
class Schema extends SchemaProvider
7777
{
@@ -171,7 +171,6 @@ namespace App\JsonApi\Podcasts;
171171

172172
use App\Jobs\ProcessPodcast;
173173
use CloudCreativity\LaravelJsonApi\Eloquent\AbstractAdapter;
174-
use Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface;
175174

176175
class Adapter extends AbstractAdapter
177176
{

docs/features/media-types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,14 +370,14 @@ data. For example:
370370
```php
371371
namespace App\JsonApi\Posts;
372372

373+
use CloudCreativity\LaravelJsonApi\Contracts\Http\Query\QueryParametersInterface;
373374
use CloudCreativity\LaravelJsonApi\Eloquent\AbstractAdapter;
374-
use Neomerx\JsonApi\Contracts\Encoder\Parameters\EncodingParametersInterface;
375375

376376
class Adapter extends AbstractAdapter
377377
{
378378
// ...
379379

380-
public function create(array $document, EncodingParametersInterface $parameters)
380+
public function create(array $document, QueryParametersInterface $parameters)
381381
{
382382
if ($this->didDecode('application/json')) {
383383
$document = [

docs/fetching/inclusion.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Introduction
44

5-
This package supports the [inclusion of related resources](http://jsonapi.org/format/1.0/#fetching-includes).
5+
This package supports the [inclusion of related resources](http://jsonapi.org/format/1.0/#fetching-includes).
66
This allows a client to specify resources related to the primary data that should be included in the response.
77
The purpose is to allow the client to reduce the number of HTTP requests it needs to make to obtain all the data
88
it requires.
@@ -20,13 +20,13 @@ For this feature to work, you will need to:
2020
default validators do not allow include paths.
2121
2. Add relationships to the resource [Schema](../basics/schemas.md) and ensure they return data.
2222
3. For Eloquent models, define the translation of any JSON API include paths to eager load paths
23-
on the resource [Adapter](../basics/adapters.md).
23+
on the resource [Adapter](../basics/adapters.md).
2424

2525
These are all described in this chapter.
2626

2727
## The Include Query Parameter
2828

29-
Related resources are specified by the client using the `include` query parameter. This parameter
29+
Related resources are specified by the client using the `include` query parameter. This parameter
3030
contains a comma separated list of relationship paths that should be included. The response will be a
3131
[compound document](http://jsonapi.org/format/#document-compound-documents) where the primary data of the
3232
request is in the JSON's `data` member, and the related resources are in the `included` member.
@@ -37,7 +37,7 @@ resources in the same request:
3737
```http
3838
GET /api/posts?include=author,tags HTTP/1.1
3939
Accept: application/vnd.api+json
40-
```
40+
```
4141

4242
If these include paths are valid, then the client will receive the following response:
4343

@@ -79,7 +79,7 @@ Content-Type: application/vnd.api+json
7979
"links": {
8080
"self": "/api/posts/123/relationships/tags",
8181
"related": "/api/posts/123/tags"
82-
}
82+
}
8383
}
8484
},
8585
"links": {
@@ -130,7 +130,7 @@ relationship, the client could request the following:
130130
```http
131131
GET /api/posts?include=author.address,tags HTTP/1.1
132132
Accept: application/vnd.api+json
133-
```
133+
```
134134

135135
For this request, both the author `users` resource and the user's `addresses` resource would be present in
136136
the `included` member of the JSON document.
@@ -201,7 +201,7 @@ class Validators extends AbstractValidators
201201
'author.address',
202202
'tags'
203203
];
204-
204+
205205
// ...
206206
}
207207
```
@@ -235,7 +235,7 @@ the posts schema would have to return both the related author and the related ta
235235
```php
236236
namespace App\JsonApi\Posts;
237237

238-
use Neomerx\JsonApi\Schema\SchemaProvider;
238+
use CloudCreativity\LaravelJsonApi\Schema\SchemaProvider;
239239

240240
class Schema extends SchemaProvider
241241
{
@@ -278,7 +278,7 @@ method on the `users` schema.
278278

279279
## Eager Loading
280280

281-
The Eloquent adapter automatically converts JSON API include paths to Eloquent model
281+
The Eloquent adapter automatically converts JSON API include paths to Eloquent model
282282
[eager loading](https://laravel.com/docs/eloquent-relationships#eager-loading) paths.
283283
The JSON API path is converted to a camel-case path. For example, the JSON API path
284284
`author.current-address` is converted to the `author.currentAddress` Eloquent path.
@@ -299,7 +299,7 @@ class Adapter extends AbstractAdapter
299299
'author' => 'createdBy',
300300
'author.current-address' => 'createdBy.currentAddress',
301301
];
302-
302+
303303
// ...
304304
}
305305
```
@@ -324,7 +324,7 @@ requested as primary data:
324324
```php
325325
namespace App\JsonApi\Posts;
326326

327-
use Neomerx\JsonApi\Schema\SchemaProvider;
327+
use CloudCreativity\LaravelJsonApi\Schema\SchemaProvider;
328328

329329
class Schema extends SchemaProvider
330330
{
@@ -344,7 +344,7 @@ This would mean that the following request receive a response with `users` and `
344344
```http
345345
GET /api/posts HTTP/1.1
346346
Accept: application/vnd.api+json
347-
```
347+
```
348348

349349
### Default Path Eager Loading
350350

@@ -359,7 +359,7 @@ use CloudCreativity\LaravelJsonApi\Eloquent\AbstractAdapter;
359359
class Adapter extends AbstractAdapter
360360
{
361361
protected $defaultWith = ['author', 'tags'];
362-
362+
363363
// ...
364364
}
365365
```

docs/fetching/pagination.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,10 +515,11 @@ For example:
515515

516516
```php
517517
use CloudCreativity\LaravelJsonApi\Contracts\Pagination\PagingStrategyInterface;
518+
use CloudCreativity\LaravelJsonApi\Contracts\Http\Query\QueryParametersInterface;
518519

519520
class DateRangeStrategy implements PagingStrategyInterface
520521
{
521-
public function paginate($query, EncodingParametersInterface $pagingParameters)
522+
public function paginate($query, QueryParametersInterface $pagingParameters)
522523
{
523524
// ...paging logic here, that returns a JSON API page object.
524525
}

0 commit comments

Comments
 (0)