Laravel Framework 5.4 Custom error Page setup
Encountered in the development of if this connection is the correct access address
Http://localhost/cky/ckyweb/public/admin/userlist?page=2
Then an error message will appear if I casually add a character at the end of this connection.
This is not allowed after the website is launched, so it is set up and distributed according to the definition error information page of the laravel framework.
First, you need to define the view view page, 404.blade.php page.
Then you need to find the Handler.php file in the Exceptions directory in the app directory and enter the file to modify the render method in this file.
The details are as follows:
Public function render ($request, Exception $exception) {if ($exception) {return response ()-> view ('error.'.$exception- > getStatusCode (), [], $exception- > getStatusCode ());} return parent::render ($request, $exception);}
Note:
If your custom page has parameters, you need to go through the
Return response ()-> view ('error.'.$exception- > getStatusCode (), [' parameters, parameters.'], $exception- > getStatusCode ()