I am new to Laravel. I need to add a custom error handler. I tried adding the code below to my file global.php:
App::error(function(CustomException $exception, $code)
{
echo 'Debug: CustomException<br/>';
});
To throw this error, I used the code below in one of my controllers:
throw new CustomException();
But I get an error because CustomException was not found.
I searched for it for a solution, but everywhere I find the same solution.
Please help me fix this.
source
share