Skip to content

Commit 71f61a8

Browse files
authored
fix: crash when API resource __construct enforces type in ResponseFromApiResource (#1028)
1 parent cb22692 commit 71f61a8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Attributes/ResponseFromApiResource.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public function isCollection(): bool
4444
return $this->collection;
4545
}
4646

47-
$className = $this->name;
48-
return (new $className(new \Illuminate\Http\Resources\MissingValue)) instanceof ResourceCollection;
47+
return is_subclass_of($this->name, ResourceCollection::class);
4948
}
5049
}

0 commit comments

Comments
 (0)