Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 591e5af

Browse files
Laravel 10.x Compatibility (#637)
1 parent 921110a commit 591e5af

File tree

8 files changed

+25
-42
lines changed

8 files changed

+25
-42
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+
## Unreleased (6.0)
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: 7 additions & 7 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."
@@ -72,7 +72,7 @@
7272
}
7373
}
7474
},
75-
"minimum-stability": "stable",
75+
"minimum-stability": "dev",
7676
"prefer-stable": true,
7777
"config": {
7878
"sort-packages": true

‎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/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/GeneratorsTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ protected function setUp(): void
4545
{
4646
parent::setUp();
4747

48+
$this->markTestSkipped('@TODO requires bugfix: https://github.com/laravel/framework/pull/45864');
49+
4850
// required for tests to work in Laravel 5.7
4951
if (method_exists($this, 'withoutMockingConsoleOutput')) {
5052
$this->withoutMockingConsoleOutput();

‎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)

AltStyle によって変換されたページ (->オリジナル) /