Skip to content

Commit

Permalink
Some Laravel 11 related compat updates (#45)
Browse files Browse the repository at this point in the history
* Allow to upgrade blueprint to new v0.5
Fix an issue with transforming stdclass response (42)

* cs

* More cs
  • Loading branch information
specialtactics authored May 9, 2024
1 parent 4f8e3d9 commit f695c57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}],
"require": {
"php": "^8.0",
"dingo/blueprint": "^0.4.5",
"dingo/blueprint": "~0.4",
"illuminate/routing": "^9.0|^10.0|^11.0",
"illuminate/support": "^9.0|^10.0|^11.0",
"league/fractal": "^0.20"
Expand Down
3 changes: 3 additions & 0 deletions src/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Dingo\Api\Http;

use ArrayObject;
use stdClass;
use Illuminate\Support\Str;
use UnexpectedValueException;
use Illuminate\Http\JsonResponse;
Expand Down Expand Up @@ -152,6 +153,8 @@ public function morph($format = 'json')
$this->content = $formatter->formatEloquentCollection($this->content);
} elseif (is_array($this->content) || $this->content instanceof ArrayObject || $this->content instanceof Arrayable) {
$this->content = $formatter->formatArray($this->content);
} elseif ($this->content instanceof stdClass) {
$this->content = $formatter->formatArray((array) $this->content);
} else {
if (! empty($defaultContentType)) {
$this->headers->set('Content-Type', $defaultContentType);
Expand Down

0 comments on commit f695c57

Please sign in to comment.