File tree 2 files changed +4
-1
lines changed
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change 14
14
}],
15
15
"require" : {
16
16
"php" : " ^8.0" ,
17
- "dingo/blueprint" : " ^ 0.4.5 " ,
17
+ "dingo/blueprint" : " ~ 0.4" ,
18
18
"illuminate/routing" : " ^9.0|^10.0|^11.0" ,
19
19
"illuminate/support" : " ^9.0|^10.0|^11.0" ,
20
20
"league/fractal" : " ^0.20"
Original file line number Diff line number Diff line change 3
3
namespace Dingo \Api \Http ;
4
4
5
5
use ArrayObject ;
6
+ use stdClass ;
6
7
use Illuminate \Support \Str ;
7
8
use UnexpectedValueException ;
8
9
use Illuminate \Http \JsonResponse ;
@@ -152,6 +153,8 @@ public function morph($format = 'json')
152
153
$ this ->content = $ formatter ->formatEloquentCollection ($ this ->content );
153
154
} elseif (is_array ($ this ->content ) || $ this ->content instanceof ArrayObject || $ this ->content instanceof Arrayable) {
154
155
$ this ->content = $ formatter ->formatArray ($ this ->content );
156
+ } elseif ($ this ->content instanceof stdClass) {
157
+ $ this ->content = $ formatter ->formatArray ((array ) $ this ->content );
155
158
} else {
156
159
if (! empty ($ defaultContentType )) {
157
160
$ this ->headers ->set ('Content-Type ' , $ defaultContentType );
You can’t perform that action at this time.
0 commit comments