Took me a minute to track this one down because Nova uses its own exception handler - not the default App\Exceptions\Handler.. :/
To show errors in production, you'll need to override the NovaExceptionHandler in your NovaServiceProvider, like so:
class NovaServiceProvider extends NovaApplicationServiceProvider
{
protected function registerExceptionHandler()
{
$this->app->bind(ExceptionHandler::class, CustomHandler::class);
}
....
Then, inside this custom handler, you can customize the logic for showing exceptions thrown inside this exception handler. To show ALL errors thrown, you'll need to override any methods that use the config helper to get the value of 'app.debug'.
(e.g. config('app.debug')) Those methods are:
- prepareResponse
- renderExceptionContent
- convertExceptionToArray
My implementation includes these helper methods in this new handler:
private function userIsAdmin()
{
if ($user = \Auth::user()) {
return $user->can('seeErrors');
}
return false;
}
private function shouldShowErrors()
{
return config('app.debug') || $this->userIsAdmin();
}
Does this answer your question?