Skip to content

Commit f695c57

Browse files
Some Laravel 11 related compat updates (#45)
* Allow to upgrade blueprint to new v0.5 Fix an issue with transforming stdclass response (42) * cs * More cs
1 parent 4f8e3d9 commit f695c57

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}],
1515
"require": {
1616
"php": "^8.0",
17-
"dingo/blueprint": "^0.4.5",
17+
"dingo/blueprint": "~0.4",
1818
"illuminate/routing": "^9.0|^10.0|^11.0",
1919
"illuminate/support": "^9.0|^10.0|^11.0",
2020
"league/fractal": "^0.20"

src/Http/Response.php

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Dingo\Api\Http;
44

55
use ArrayObject;
6+
use stdClass;
67
use Illuminate\Support\Str;
78
use UnexpectedValueException;
89
use Illuminate\Http\JsonResponse;
@@ -152,6 +153,8 @@ public function morph($format = 'json')
152153
$this->content = $formatter->formatEloquentCollection($this->content);
153154
} elseif (is_array($this->content) || $this->content instanceof ArrayObject || $this->content instanceof Arrayable) {
154155
$this->content = $formatter->formatArray($this->content);
156+
} elseif ($this->content instanceof stdClass) {
157+
$this->content = $formatter->formatArray((array) $this->content);
155158
} else {
156159
if (! empty($defaultContentType)) {
157160
$this->headers->set('Content-Type', $defaultContentType);

0 commit comments

Comments
 (0)