Skip to content

Commit

Permalink
fix laravel
Browse files Browse the repository at this point in the history
  • Loading branch information
soyuka committed Jan 27, 2025
1 parent c56b1af commit cef72ca
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public function __construct(
*/
public function create(string $resourceClass, string $property, array $options = []): ApiProperty
{
if (!is_a($resourceClass, Model::class, true)) {
return $this->decorated?->create($resourceClass, $property, $options) ?? new ApiProperty();
}

try {
$refl = new \ReflectionClass($resourceClass);
$model = $refl->newInstanceWithoutConstructor();
Expand Down

0 comments on commit cef72ca

Please sign in to comment.