Skip to content

Commit

Permalink
Revert "Update ControllerDecorator.php for Laravel 9 and 10 compatibi…
Browse files Browse the repository at this point in the history
…lity (#266)"

This reverts commit 54b73e2.
  • Loading branch information
lorisleiva committed Jan 9, 2024
1 parent 54b73e2 commit 5d2e2a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Decorators/ControllerDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ public function __invoke(string $method)

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

if ($this->hasMethod('jsonResponse') && ($request->expectsJson() || $request->isJson())) {
if ($this->hasMethod('jsonResponse') && $request->expectsJson()) {
$response = $this->callMethod('jsonResponse', [$response, $request]);
} elseif ($this->hasMethod('htmlResponse') && ! ($request->expectsJson() || $request->isJson())) {
} elseif ($this->hasMethod('htmlResponse') && ! $request->expectsJson()) {
$response = $this->callMethod('htmlResponse', [$response, $request]);
}

Expand Down

0 comments on commit 5d2e2a6

Please sign in to comment.