Skip to content

Commit 418d5f6

Browse files
committed
fix to return raw model attributes instead of calling Only on the Model object
1 parent 4bfdadb commit 418d5f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Illuminate/Http/Resources/Json/Resource.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,9 @@ protected function mergeWhen($condition, $value)
255255
*/
256256
protected function attributes($attributes)
257257
{
258-
return new MergeValue($this->resource->only($attributes));
258+
return new MergeValue(
259+
array_only($this->resource->toArray(), $attributes)
260+
);
259261
}
260262

261263
/**

0 commit comments

Comments
 (0)