Skip to content

Commit 5d2e2a6

Browse files
committed
Revert "Update ControllerDecorator.php for Laravel 9 and 10 compatibility (#266)"
This reverts commit 54b73e2.
1 parent 54b73e2 commit 5d2e2a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Decorators/ControllerDecorator.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ public function __invoke(string $method)
7070

7171
$response = $this->run($method);
7272

73-
if ($this->hasMethod('jsonResponse') && ($request->expectsJson() || $request->isJson())) {
73+
if ($this->hasMethod('jsonResponse') && $request->expectsJson()) {
7474
$response = $this->callMethod('jsonResponse', [$response, $request]);
75-
} elseif ($this->hasMethod('htmlResponse') && ! ($request->expectsJson() || $request->isJson())) {
75+
} elseif ($this->hasMethod('htmlResponse') && ! $request->expectsJson()) {
7676
$response = $this->callMethod('htmlResponse', [$response, $request]);
7777
}
7878

0 commit comments

Comments
 (0)