I am trying to display a custom error page instead of the default Laravel 5 message :
"Whoops...looks like something went wrong"
I made a lot of search before posting here, I tried this solution, which should work on Laravel 5 but had no luck with it : https://laracasts.com/discuss/channels/laravel/change-whoops-looks-like-something-went-wrong-page
Here is the exact code I have in my app/Exceptions/Handler.php
file :
<?php namespace AppExceptions;
use Exception;
use View;
use BugsnagBugsnagLaravelBugsnagExceptionHandler as ExceptionHandler;
class Handler extends ExceptionHandler {
protected $dontReport = [
'SymfonyComponentHttpKernelExceptionHttpException'
];
public function report(Exception $e)
{
return parent::report($e);
}
public function render($request, Exception $e)
{
return response()->view('errors.defaultError');
}
}
But, instead of displaying my custom view, a blank page is showing. I also tried with this code inside render()
function
return "Hello, I am an error message";
But I get same result : blank page
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…