Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit 318878d

Browse files
authored
Update BaseApiResource.php
7.2PHP count warning if return Object and not Collection
1 parent 2cadfb6 commit 318878d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Http/Resources/BaseApiResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ protected function relationships()
165165
}
166166

167167
$data = $this->resource->$relationship;
168-
if (0 == count($data)) {
168+
if ($data instanceof Countable && 0 == count($data)) {
169169
continue;
170170
}
171171

0 commit comments

Comments
 (0)