Hi,
thanks for your messages.
I have been using resources/views/errors/404.blade.php and 500.blade.php files. There are no any problem 4xx and 5xx exceptions.
But When the session expired, it throws TokenMismatchException. I have received "Whoops, looks like something went wrong" page in Laravel5. So, I changed the VerifyCsrfToken.php. it is OK now.
App\Http\Middleware\VerifyCsrfToken.php
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
class VerifyCsrfToken extends BaseVerifier
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if ($this->isReading($request) || $this->tokensMatch($request)) {
return $this->addCookieToResponse($request, $next($request));
}
return redirect("/")->with("alert", "error message to user interface");
#throw new TokenMismatchException;
}
}
If you want to display a custom error page, you need to render a view instead of redirect.