Answer the question
In order to leave comments, you need to log in
How to change layout of 404 error in Laravel?
Good afternoon.
We need to change the 404 error template, and also figure out how to change them in Laravel in the future.
On Toster alone there were at least 3 of them:
Laravel 5 and 404 template: how to pass data to the template?
How to make a 404 page in laravel 5?
How to put 404 instead of error page in laravel 5?
However, none of the tips helped:
Created a 404.blade.php file in resources\views\errors\404
Registered an error output in Handler.php
Different ways of rendering the template did not work either.
What else could be the problem or what is wrong?
Laraverl v.1.3.5
Handler.php
public function render($request, Exception $exception)
{
if($exception instanceof \Symphony\Component\HttpKernel\Exception\NotFoundHttpException
or $exception instanceof \Illuminate\Database\Eloquent\ModelNotFoundException){
return abort(404);
}
return parent::render($request, $exception);
}
Answer the question
In order to leave comments, you need to log in
Everything turned out to be extremely simple: it was necessary to edit the settings in the server so that there was no public/index.php in the address bar.
After changes in the settings, everything is immediately displayed.
Those. all the hints and links above turned out to be correct.
To change the address bar in Laravel, here is a link (I found it enough to rename server.php etc.):
stackoverflow.com/questions/28364496/laravel-5-rem...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question