Skip to content

Commit

Permalink
Add compatibility for Laravel 5.5 (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
alquerci authored May 12, 2020
1 parent afd69ad commit d76dea4
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 6 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ env:
- LARAVEL_VERSION=5.8.* TESTBENCH_VERSION=3.8.*
- LARAVEL_VERSION=5.7.* TESTBENCH_VERSION=3.7.*
- LARAVEL_VERSION=5.6.* TESTBENCH_VERSION=3.6.*
- LARAVEL_VERSION=5.5.* TESTBENCH_VERSION=3.5.*

before_script:
- composer self-update
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Rapid pagination without using OFFSET
## Requirements

- PHP: ^7.1
- Laravel: ^5.6 || ^6.0 || ^7.0
- Laravel: ^5.5 || ^5.6 || ^6.0 || ^7.0
- [lampager/lampager](https://github.com/lampager/lampager): ^0.4

## Installing
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"php": "^7.1",
"ext-json": "*",
"lampager/lampager": "^0.4",
"illuminate/contracts": "^5.6 || ^6.0 || ^7.0 || ^8.0",
"illuminate/support": "^5.6 || ^6.0 || ^7.0 || ^8.0",
"illuminate/database": "^5.6 || ^6.0 || ^7.0 || ^8.0"
"illuminate/contracts": "^5.5 || ^5.6 || ^6.0 || ^7.0 || ^8.0",
"illuminate/support": "^5.5 || ^5.6 || ^6.0 || ^7.0 || ^8.0",
"illuminate/database": "^5.5 || ^5.6 || ^6.0 || ^7.0 || ^8.0"
},
"require-dev": {
"orchestra/testbench": "^4.0",
Expand Down
21 changes: 21 additions & 0 deletions tests/JsonResource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Lampager\Laravel\Tests;

use Illuminate\Http\Resources\Json\JsonResource as BaseJsonResource;

if (class_exists(BaseJsonResource::class)) {
/**
* To support testing Laravel version 7 and up.
*/
class JsonResource extends BaseJsonResource
{
}
} else {
/**
* To support testing until Laravel version 7.
*/
class JsonResource extends \Illuminate\Http\Resources\Json\Resource
{
}
}
1 change: 0 additions & 1 deletion tests/PostResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Lampager\Laravel\Tests;

use Illuminate\Http\Resources\Json\JsonResource;
use Lampager\Laravel\LampagerResourceTrait;

/**
Expand Down
1 change: 0 additions & 1 deletion tests/TagResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Lampager\Laravel\Tests;

use Illuminate\Http\Resources\Json\JsonResource;
use Lampager\Laravel\LampagerResourceTrait;

/**
Expand Down

0 comments on commit d76dea4

Please sign in to comment.