Skip to content

Commit

Permalink
Update JsonResponse.php
Browse files Browse the repository at this point in the history
  • Loading branch information
BenRutlandWeb authored Apr 27, 2022
1 parent 313a468 commit 2ea305c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Http/JsonResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public function setData($data = []): self
$content = $data->jsonSerialize();
} elseif ($data instanceof Arrayable) {
$content = $data->toArray();
} elseif (is_array($data)) {
$content = $data;
} elseif (method_exists($data, 'to_array')) {
$content = $data->to_array();
} else {
Expand Down

0 comments on commit 2ea305c

Please sign in to comment.