10000 Merge branch 'develop' into 3.x · laravel-json-api/laravel@0e1b9b2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0e1b9b2

Browse files
committed
Merge branch 'develop' into 3.x
2 parents 3aa779e + 2a8c0dc commit 0e1b9b2

File tree

146 files changed

+622
-162
lines changed

Some content is hidden

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

146 files changed

+622
-162
lines changed

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ jobs:
1414
strategy:
1515
fail-fast: true
1616
matrix:
17-
php: [7.4, '8.0', 8.1]
17+
php: [7.4, '8.0', 8.1, 8.2]
1818
laravel: [8.76, 9]
1919
exclude:
2020
- php: 7.4
2121
laravel: 9
2222

2323
steps:
2424
- name: Checkout Code
25-
uses: actions/checkout@v2
25+
uses: actions/checkout@v3
2626

2727
- name: Setup PHP
2828
uses: shivammathur/setup-php@v2
@@ -37,7 +37,7 @@ jobs:
3737
run: composer require "laravel/framework:^${{ matrix.laravel }}" --no-update
3838

3939
- name: Install dependencies
40-
uses: nick-invision/retry@v1
40+
uses: nick-fields/retry@v2
4141
with:
4242
timeout_minutes: 5
4343
max_attempts: 5

CHANGELOG.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,29 @@ All notable changes to this project will be documented in this file. This projec
1212
type, so anything could be sent. This is incorrect as the JSON:API specification shows the `Accept` header as
1313
`application/vnd.api+json` for [delete resource requests.](https://jsonapi.org/format/#crud-deleting)
1414

15-
## Unreleased
15+
## [2.5.1] - 2023-01-23
16+
17+
### Fixed
18+
19+
- [#223](https://github.com/laravel-json-api/laravel/issues/223) Ensure Eloquent models always have fresh data after
20+
write operation. This is to prevent cached relationships from having "stale" data after the write operation. This can
21+
occur if a related model's attributes change during the write operation, but the related model was cached before the
22+
write operation occurred.
23+
24+
## [2.5.0] - 2023-01-15
25+
26+
### Added
27+
28+
- Relations can now be conditionally set to be eager-loadable via the `canEagerLoad()` method.
29+
- New `WhereNull` and `WhereNotNull` filters.
30+
31+
### Fixed
32+
33+
- [#204](https://github.com/laravel-json-api/laravel/issues/204) Fix exception parser causing error when request does
34+
not have a matching route (e.g. in a `404 Not Found` scenario).
35+
- Fixed PHP 8.2 deprecation messages in the `laravel-json-api/validation` dependency.
36+
37+
## [2.4.0] - 2022-06-25
1638

1739
### Added
1840

@@ -29,6 +51,7 @@ All notable changes to this project will be documented in this file. This projec
2951
- [#184](https://github.com/laravel-json-api/laravel/issues/184) Ensure that an `Accept` header with the media type
3052
`application/json` is rejected with a `406 Not Acceptable` response. Previously this media type worked, which is
3153
incorrect as the JSON:API specification requires the media type `application/vnd.api+json`.
54+
- [#197](https://github.com/laravel-json-api/laravel/pull/197) Fix sending `null` for a to-one relationship update.
3255

3356
## [2.3.0] - 2022-04-11
3457

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@
2525
"require": {
2626
"php": "^7.4|^8.0",
2727
"ext-json": "*",
28-
"laravel-json-api/core": "^2.3",
29-
"laravel-json-api/eloquent": "^2.1.1",
30-
"laravel-json-api/encoder-neomerx": "^2.0",
31-
"laravel-json-api/exceptions": "^1.1",
28+
"laravel-json-api/core": "^2.4",
29+
"laravel-json-api/eloquent": "^2.2.1",
30+
"laravel-json-api/encoder-neomerx": "^2.0.1",
31+
"laravel-json-api/exceptions": "^1.1.1",
3232
"laravel-json-api/spec": "^1.2",
33-
"laravel-json-api/validation": "^2.1",
33+
"laravel-json-api/validation": "^2.1.1",
3434
"laravel/framework": "^8.76|^9.0"
3535
},
3636
"require-dev": {
37-
"laravel-json-api/testing": "^1.1",
37+
"laravel-json-api/testing": "^1.1.2",
3838
"orchestra/testbench": "^6.23|^7.0",
3939
"phpunit/phpunit": "^9.5.10"
4040
},

src/Console/Concerns/ResolvesStub.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.

src/Console/GeneratorCommand.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.

src/Console/MakeAuthorizer.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.

src/Console/MakeController.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.

src/Console/MakeFilter.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.

src/Console/MakeQuery.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.

src/Console/MakeRequest.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.

src/Console/MakeRequests.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.

src/Console/MakeResource.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.

src/Console/MakeSchema.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.

src/Console/MakeServer.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.

src/Console/MakeSortField.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.

src/Console/StubPublish.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.

src/Exceptions/HttpNotAcceptableException.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.

src/Exceptions/HttpUnsupportedMediaTypeException.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.

src/Facades/JsonApiRoute.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.

src/Http/Controllers/Actions/AttachRelationship.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.

src/Http/Controllers/Actions/Destroy.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.

src/Http/Controllers/Actions/DetachRelationship.php

Lines changed: 2 additions & 2 deletions
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.
@@ -32,7 +32,7 @@ trait DetachRelationship
3232
{
3333

3434
/**
35-
* Attach records to a has-many relationship.
35+
* Detach records to a has-many relationship.
3636
*
3737
* @param Route $route
3838
* @param StoreContract $store

src/Http/Controllers/Actions/FetchMany.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.

src/Http/Controllers/Actions/FetchOne.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.

src/Http/Controllers/Actions/FetchRelated.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.

src/Http/Controllers/Actions/FetchRelationship.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.

src/Http/Controllers/Actions/Store.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.

src/Http/Controllers/Actions/Update.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.

src/Http/Controllers/Actions/UpdateRelationship.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.

src/Http/Controllers/JsonApiController.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.

src/Http/Middleware/BootJsonApi.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.

src/Http/Requests/AnonymousCollectionQuery.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.

src/Http/Requests/AnonymousQuery.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.

src/Http/Requests/FormRequest.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.

src/Http/Requests/RequestResolver.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.

src/Http/Requests/ResourceQuery.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.

src/Http/Requests/ResourceRequest.php

Lines changed: 2 additions & 2 deletions
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.
@@ -204,7 +204,7 @@ public function document(): array
204204
{
205205
$document = $this->json()->all();
206206

207-
if (!is_array($document) || !isset($document['data']) || !is_array($document['data'])) {
207+
if (!is_array($document) || !array_key_exists('data', $document) || !(is_array($document['data']) || is_null($document['data']))) {
208208
throw new LogicException('Expecting JSON API specification compliance to have been run.');
209209
}
210210

src/LaravelJsonApi.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.

src/Routing/ActionProxy.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.

0 commit comments

Comments
 (0)
0