Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Laravel 7.0 and 8.0 prepare
  • Loading branch information
Julius Smatavicius committed Dec 10, 2020
commit 2eb42c2b5b986326fd7f5c2f4336e20f85d36978
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ npm-debug.log
yarn-error.log
.env
composer.lock
.php_cs.cache
.php_cs.cache
.phpunit.result.cache
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ language: php
matrix:
include:
- php: "7.2"
env: LARAVEL_VERSION="5.8.*"
env: LARAVEL_VERSION="7.0.*"
- php: "7.3"
env: LARAVEL_VERSION="5.8.*"
env: LARAVEL_VERSION="7.0.*"
- php: "7.4"
env: LARAVEL_VERSION="7.0.*"
- php: "7.2"
env: LARAVEL_VERSION="6.0.*"
env: LARAVEL_VERSION="8.0.*"
- php: "7.3"
env: LARAVEL_VERSION="6.0.*" $RUN_CS_FIXER=1
env: LARAVEL_VERSION="8.0.*"
- php: "7.4"
env: LARAVEL_VERSION="8.0.*" $RUN_CS_FIXER=1

sudo: false

Expand Down
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,19 @@
],
"require": {
"php": ">=7.2",
"ext-json": "*",
"astrotomic/laravel-translatable": "^11.6",
"laravel/framework": "^5.8|^6.0"
"laravel/framework": "^7.0|^8.0"
},
"require-dev": {
"filp/whoops": "~2.0",
"friendsofphp/php-cs-fixer": "^2.16",
"mockery/mockery": "^1.0",
"orchestra/testbench": "3.8.*|^4.0",
"phpunit/php-code-coverage": "^6.0|^7.0",
"phpunit/phpunit": "^7.0|^8.0",
"orchestra/testbench": "^5.0|^6.0",
"phpunit/php-code-coverage": "^7.0",
"phpunit/phpunit": "^8.0",
"spatie/phpunit-watcher": "^1.3",
"squizlabs/php_codesniffer": "^2.3|^3.5"
"squizlabs/php_codesniffer": "^3.5"
},
"autoload": {
"psr-4": {
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Resources/BaseApiResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\Resource;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Swis\JsonApi\Server\Traits\HandlesRelationships;

class BaseApiResource extends Resource
class BaseApiResource extends JsonResource
{
use HandlesRelationships;

Expand Down Expand Up @@ -44,7 +44,7 @@ public function setValues()
if (!$this->resource) {
return;
}
$this->resource->addHidden($this->resource->getKeyName());
$this->resource->makeHidden($this->resource->getKeyName());

$this->jsonApiModel->setId((string) $this->resource->getKey());
$this->jsonApiModel->setType($this->getResourceType());
Expand Down