Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.
Merged
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
Add is_array to the countable check should a plain array be the res…
…ult.
  • Loading branch information
bbrala committed Oct 30, 2018
commit 9d3e174b7889c23fe0f949a19b39bd3fb5c52ee0
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 ($data instanceof Countable && 0 == count($data)) {
if ((is_array($data) || $data instanceof \Countable) && 0 == count($data)) {
continue;
}

Expand Down