We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5250614 commit 54b73e2Copy full SHA for 54b73e2
src/Decorators/ControllerDecorator.php
@@ -70,9 +70,9 @@ public function __invoke(string $method)
70
71
$response = $this->run($method);
72
73
- if ($this->hasMethod('jsonResponse') && $request->expectsJson()) {
+ if ($this->hasMethod('jsonResponse') && ($request->expectsJson() || $request->isJson())) {
74
$response = $this->callMethod('jsonResponse', [$response, $request]);
75
- } elseif ($this->hasMethod('htmlResponse') && ! $request->expectsJson()) {
+ } elseif ($this->hasMethod('htmlResponse') && ! ($request->expectsJson() || $request->isJson())) {
76
$response = $this->callMethod('htmlResponse', [$response, $request]);
77
}
78
0 commit comments