Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.
Merged
Changes from all commits
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
Update BaseApiResource.php
7.2PHP count warning if return Object and not Collection
  • Loading branch information
bondas83 authored Oct 29, 2018
commit 318878d2000e93547428aa043d6eafba1bcff39d
2 changes: 1 addition & 1 deletion src/Http/Resources/BaseApiResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ protected function relationships()
}

$data = $this->resource->$relationship;
if (0 == count($data)) {
if ($data instanceof Countable && 0 == count($data)) {
continue;
}

Expand Down