8000 [Build] Make Laravel 7 minimum version · CodingSeo/laravel-json-api@ed67d50 · GitHub
[go: up one dir, main page]

Skip to content

Commit ed67d50

Browse files
committed
[Build] Make Laravel 7 minimum version
1 parent 811cf9c commit ed67d50

File tree

8 files changed

+32
-30
lines changed

8 files changed

+32
-30
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ matrix:
1010
include:
1111
- php: "7.2"
1212
env:
13-
- LARAVEL_VERSION=^6.0
13+
- LARAVEL_VERSION=^7.0
1414
- php: "7.3"
1515
env:
16-
- LARAVEL_VERSION=^6.0
16+
- LARAVEL_VERSION=^7.0
1717
- php: "7.4"
1818
env:
19-
- LARAVEL_VERSION=^6.0
19+
- LARAVEL_VERSION=^7.0
2020

2121
install:
2222
- composer require "laravel/framework:${LARAVEL_VERSION}" --no-update -n

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ floats. This is to ensure that the developer is correctly testing boolean filter
1414

1515
### Changed
1616
- Minimum PHP version is now `7.2`.
17-
- Minimum Laravel version is now `6.0`.
17+
- Minimum Laravel version is now `7.0`.
1818
- Amended the store interface so that it always takes a string resource type and string id,
1919
instead of the deprecated resource identifier object.
2020
- Moved the `Validation\ErrorTranslator` class to `Error\Translator`.

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ A demo application is available at [here](https://github.com/cloudcreativity/dem
6262

6363
| Laravel | This Package |
6464
| --- | --- |
65-
| `^6.0` | `^2.0` |
65+
| `^7.0` | `^2.0` |
66+
| `^6.0` | `^1.0` |
6667
| `5.8.*` | `^1.0` |
6768
| `5.7.*` | `^1.0` |
6869
| `5.6.*` | `^1.0` |
@@ -71,9 +72,6 @@ A demo application is available at [here](https://github.com/cloudcreativity/dem
7172
Make sure you consult the [Upgrade Guide](http://laravel-json-api.readthedocs.io/en/latest/upgrade/)
7273
when upgrading between major or pre-release versions.
7374

74-
> You may notice that there are `2.0.0-alpha` tags. We **do not** recommend using these versions
75-
> until we hit `beta` releases.
76-
7775
## Lumen
7876

7977
Currently we have not integrated the package with Lumen. We do not have any active projects that use Lumen,

composer.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
"require": {
2525
"php": "^7.2",
2626
"ext-json": "*",
27-
"illuminate/console": "^6.0",
28-
"illuminate/contracts": "^6.0",
29-
"illuminate/database": "^6.0",
30-
"illuminate/filesystem": "^6.0",
31-
"illuminate/http": "^6.0",
32-
"illuminate/pagination": "^6.0",
33-
"illuminate/support": "^6.0",
27+
"illuminate/console": "^7.0",
28+
"illuminate/contracts": "^7.0",
29+
"illuminate/database": "^7.0",
30+
"illuminate/filesystem": "^7.0",
31+
"illuminate/http": "^7.0",
32+
"illuminate/pagination": "^7.0",
33+
"illuminate/support": "^7.0",
3434
"neomerx/json-api": "^1.0.3",
3535
"nyholm/psr7": "^1.2",
3636
"ramsey/uuid": "^3.0",
@@ -40,8 +40,9 @@
4040
"ext-sqlite3": "*",
4141
"cloudcreativity/json-api-testing": "^2.1",
4242
"guzzlehttp/guzzle": "^6.3",
43+
"laravel/ui": "^2.0",
4344
"mockery/mockery": "^1.1",
44-
"orchestra/testbench": "^4.0",
45+
"orchestra/testbench": "^5.0",
4546
"phpunit/phpunit": "^8.0"
4647
},
4748
"suggest": {

src/Exceptions/HandlesErrors.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
use CloudCreativity\LaravelJsonApi\Routing\Route;
2222
use CloudCreativity\LaravelJsonApi\Services\JsonApiService;
2323
use CloudCreativity\LaravelJsonApi\Utils\Helpers;
24-
use Exception;
2524
use Illuminate\Http\Request;
2625
use Illuminate\Http\Response;
2726
use Neomerx\JsonApi\Contracts\Document\ErrorInterface;
2827
use Neomerx\JsonApi\Exceptions\JsonApiException;
2928
use Symfony\Component\HttpKernel\Exception\HttpException;
29+
use Throwable;
3030

3131
/**
3232
* Trait HandlesErrors
@@ -44,10 +44,10 @@ trait HandlesErrors
4444
* API via its Accept header.
4545
*
4646
* @param Request $request
47-
* @param Exception $e
47+
* @param Throwable $e
4848
* @return bool
4949
*/
50-
public function isJsonApi($request, Exception $e)
50+
public function isJsonApi($request, Throwable $e)
5151
{
5252
if (Helpers::wantsJsonApi($request)) {
5353
return true;
@@ -63,10 +63,10 @@ public function isJsonApi($request, Exception $e)
6363
* Render an exception as a JSON API error response.
6464
*
6565
* @param Request $request
66-
* @param Exception $e
66+
* @param Throwable $e
6767
* @return Response
6868
*/
69-
public function renderJsonApi($request, Exception $e)
69+
public function renderJsonApi($request, Throwable $e)
7070
{
7171
$headers = ($e instanceof HttpException) ? $e->getHeaders() : [];
7272

src/Testing/TestExceptionHandler.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Exception;
2222
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
2323
use Neomerx\JsonApi\Exceptions\JsonApiException;
24+
use Throwable;
2425

2526
/**
2627
* Class TestExceptionHandler
@@ -57,20 +58,20 @@ class TestExceptionHandler extends ExceptionHandler
5758
];
5859

5960
/**
60-
* @param Exception $e
61+
* @param Throwable $e
6162
* @throws Exception
6263
*/
63-
public function report(Exception $e)
64+
public function report(Throwable $e)
6465
{
6566
// no-op
6667
}
6768

6869
/**
6970
* @param \Illuminate\Http\Request $request
70-
* @param Exception $e
71-
* @return \Illuminate\Http\Response
71+
* @param Throwable $e
72+
* @return \Symfony\Component\HttpFoundation\Response
7273
*/
73-
public function render($request, Exception $e)
74+
public function render($request, Throwable $e)
7475
{
7576
if ($this->isJsonApi($request, $e)) {
7677
return $this->renderJsonApi($request, $e);
@@ -80,10 +81,10 @@ public function render($request, Exception $e)
8081
}
8182

8283
/**
83-
* @param Exception $e
84-
* @return Exception
84+
* @param Throwable $e
85+
* @return Throwable
8586
*/
86-
protected function prepareException(Exception $e)
87+
protected function prepareException(Throwable $e)
8788
{
8889
if ($e instanceof JsonApiException) {
8990
return $this->prepareJsonApiException($e);

src/Testing/TestResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
use CloudCreativity\JsonApi\Testing\Concerns\HasHttpAssertions;
2121
use CloudCreativity\JsonApi\Testing\Document;
22-
use Illuminate\Foundation\Testing\TestResponse as BaseTestResponse;
22+
use Illuminate\Testing\TestResponse as BaseTestResponse;
2323
use Illuminate\Http\Response;
2424

2525
/**

tests/lib/Integration/TestCase.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
use Illuminate\Foundation\Application;
3131
use Illuminate\Routing\Router;
3232
use Illuminate\Support\Facades\Route;
33+
use Laravel\Ui\UiServiceProvider;
3334
use Orchestra\Testbench\TestCase as BaseTestCase;
3435

3536
/**
@@ -70,6 +71,7 @@ protected function getPackageProviders($app)
7071
{
7172
return [
7273
ServiceProvider::class,
74+
UiServiceProvider::class,
7375
DummyPackage\ServiceProvider::class,
7476
DummyApp\Providers\AppServiceProvider::class,
7577
];

0 commit comments

Comments
 (0)
0