Skip to content

Commit

Permalink
Add expectsJson method to base controller
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Nov 13, 2023
1 parent 3feb14c commit 4972dae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/realtime-compiler/src/Http/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,9 @@ protected function writeToConsole(string $message, string $context = 'dashboard'
$this->console->printMessage($message, $context);
}
}

protected function expectsJson(): bool
{
return getallheaders()['Accept'] === 'application/json';
}
}

0 comments on commit 4972dae

Please sign in to comment.