Skip to content

Commit c8cc395

Browse files
committed
Merge branch 'release/6.0.0'
2 parents ab5bd65 + 0f6ddbb commit c8cc395

File tree

11 files changed

+30
-49
lines changed

11 files changed

+30
-49
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
strategy:
1515
fail-fast: true
1616
matrix:
17-
php: ['8.0', 8.1, 8.2]
18-
laravel: [9]
17+
php: [8.1, 8.2]
18+
laravel: [10]
1919

2020
steps:
2121
- name: Checkout Code

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
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+
## [6.0.0] - 2023-02-14
7+
8+
### Changed
9+
10+
- Dropped support for PHP 8.0 - minimum PHP version is now 8.1.
11+
- Upgraded to Laravel 10, dropping support for Laravel 9.
12+
613
## [5.0.0] - 2023-01-21
714

815
### Changed

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@
2222
}
2323
],
2424
"require": {
25-
"php": "^8.0",
25+
"php": "^8.1",
2626
"ext-json": "*",
2727
"laravel-json-api/neomerx-json-api": "^5.0.1",
28-
"laravel/framework": "^9.0",
28+
"laravel/framework": "^10.0",
2929
"nyholm/psr7": "^1.2",
3030
"ramsey/uuid": "^4.0",
3131
"symfony/psr-http-message-bridge": "^2.0"
3232
},
3333
"require-dev": {
3434
"ext-sqlite3": "*",
3535
"guzzlehttp/guzzle": "^7.0",
36-
"laravel-json-api/testing": "^1.1",
36+
"laravel-json-api/testing": "^2.0",
3737
"laravel/legacy-factories": "^1.0.4",
38-
"laravel/ui": "^3.0",
38+
"laravel/ui": "^4.2",
3939
"mockery/mockery": "^1.1",
40-
"orchestra/testbench": "^6.23|^7.0",
41-
"phpunit/phpunit": "^9.5.10"
40+
"orchestra/testbench": "^8.0",
41+
"phpunit/phpunit": "^9.5.28"
4242
},
4343
"suggest": {
4444
"cloudcreativity/json-api-testing": "Required to use the test helpers."

src/Queue/ClientJob.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,13 @@ class ClientJob extends Model implements AsynchronousProcess
7474
*/
7575
protected $casts = [
7676
'attempts' => 'integer',
77+
'completed_at' => 'datetime',
7778
'failed' => 'boolean',
7879
'timeout' => 'integer',
80+
'timeout_at' => 'datetime',
7981
'tries' => 'integer',
8082
];
8183

82-
/**
83-
* @var array
84-
*/
85-
protected $dates = [
86-
'completed_at',
87-
'timeout_at',
88-
];
89-
9084
/**
9185
* @inheritdoc
9286
*/

tests/dummy/app/Post.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ class Post extends Model
4343
/**
4444
* @var array
4545
*/
46-
protected $dates = [
47-
'published_at',
48-
'deleted_at',
46+
protected $casts = [
47+
'deleted_at' => 'datetime',
48+
'published_at' => 'datetime',
4949
];
5050

5151
/**

tests/lib/Integration/Eloquent/ClientGeneratedIdTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function testCreateWithInvalidId()
111111

112112
$error = [
113113
'title' => 'Unprocessable Entity',
114-
'detail' => 'The id format is invalid.',
114+
'detail' => 'The id field format is invalid.',
115115
'status' => '422',
116116
'source' => ['pointer' => '/data/id'],
117117
];

tests/lib/Integration/Eloquent/ResourceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,15 @@ public function testCreateInvalid()
270270
[
271271
'status' => '422',
272272
'title' => 'Unprocessable Entity',
273-
'detail' => 'The title must be a string.',
273+
'detail' => 'The title field must be a string.',
274274
'source' => [
275275
'pointer' => '/data/attributes/title',
276276
],
277277
],
278278
[
279279
'status' => '422',
280280
'title' => 'Unprocessable Entity',
281-
'detail' => 'The title must be between 5 and 255 characters.',
281+
'detail' => 'The title field must be between 5 and 255 characters.',
282282
'source' => [
283283
'pointer' => '/data/attributes/title',
284284
],

tests/lib/Integration/ErrorsTest.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@
1717

1818
namespace CloudCreativity\LaravelJsonApi\Tests\Integration;
1919

20-
use Carbon\Carbon;
2120
use CloudCreativity\LaravelJsonApi\Document\Error\Error;
2221
use CloudCreativity\LaravelJsonApi\Exceptions\DocumentRequiredException;
2322
use CloudCreativity\LaravelJsonApi\Exceptions\InvalidJsonException;
2423
use CloudCreativity\LaravelJsonApi\Exceptions\JsonApiException;
2524
use CloudCreativity\LaravelJsonApi\Exceptions\ResourceNotFoundException;
2625
use DummyApp\Post;
2726
use Illuminate\Contracts\Validation\Validator;
28-
use Illuminate\Foundation\Http\Exceptions\MaintenanceModeException;
2927
use Illuminate\Http\Response;
3028
use Illuminate\Session\TokenMismatchException;
3129
use Illuminate\Support\Facades\Route;
@@ -326,24 +324,6 @@ public function testJsonApiException2(): void
326324
->assertExactJson($expected);
327325
}
328326

329-
public function testMaintenanceMode()
330-
{
331-
$ex = new MaintenanceModeException(Carbon::now()->getTimestamp(), 60, "We'll be back soon.");
332-
333-
$this->request($ex)
334-
->assertStatus(503)
335-
->assertHeader('Content-Type', 'application/vnd.api+json')
336-
->assertExactJson([
337-
'errors' => [
338-
[
339-
'title' => 'Service Unavailable',
340-
'detail' => "We'll be back soon.",
341-
'status' => '503',
342-
],
343-
],
344-
]);
345-
}
346-
347327
/**
348328
* By default Laravel sends a 419 response for a TokenMismatchException.
349329
*

tests/lib/Integration/Validation/FailedMetaTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function rulesProvider(): array
7373
[
7474
'status' => '422',
7575
'title' => 'Unprocessable Entity',
76-
'detail' => 'The value must be a date before or equal to 2018-12-31 23:59:59.',
76+
'detail' => 'The value field must be a date before or equal to 2018-12-31 23:59:59.',
7777
'meta' => [
7878
'failed' => [
7979
'rule' => 'before-or-equal',
@@ -93,7 +93,7 @@ public function rulesProvider(): array
9393
[
9494
'status' => '422',
9595
'title' => 'Unprocessable Entity',
96-
'detail' => 'The value must be between 1 and 9.',
96+
'detail' => 'The value field must be between 1 and 9.',
9797
'meta' => [
9898
'failed' => [
9999
'rule' => 'between',
@@ -234,7 +234,7 @@ public function testMultiple(): void
234234
[
235235
'status' => '422',
236236
'title' => 'Unprocessable Entity',
237-
'detail' => 'The title must be a string.',
237+
'detail' => 'The title field must be a string.',
238238
'source' => [
239239
'pointer' => '/data/attributes/title',
240240
],
@@ -247,7 +247,7 @@ public function testMultiple(): void
247247
[
248248
'status' => '422',
249249
'title' => 'Unprocessable Entity',
250-
'detail' => 'The title must be between 5 and 255 characters.',
250+
'detail' => 'The title field must be between 5 and 255 characters.',
251251
'source' => [
252252
'pointer' => '/data/attributes/title',
253253
],

tests/lib/Integration/Validation/QueryValidationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function searchProvider()
7777
'page:invalid' => [
7878
['page' => ['number' => 0, 'size' => 10]],
7979
'page.number',
80-
'The page.number must be at least 1.',
80+
'The page.number field must be at least 1.',
8181
],
8282
'page:not allowed (singular)' => [
8383
['page' => ['foo' => 'bar', 'size' => 10]],

tests/package/src/Blog.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Blog extends Model
3434
/**
3535
* @var array
3636
*/
37-
protected $dates = [
38-
'published_at',
37+
protected $casts = [
38+
'published_at' => 'datetime',
3939
];
4040
}

0 commit comments

Comments
 (0)