I want to redirect Laravel version 5.2 default 404 page to my template page of 404, from where and what to change -


i using laravel version 5.2 , don't know how redirect laravel default page template 404 page

use abort(404);

some exceptions describe http error codes server. example, may "page not found" error (404), "unauthorized error" (401) or developer generated 500 error. in order generate such response anywhere in application, use following:

abort(404); 

if invoke abort(404); anywhere in route or controller throw httpnotfoundexception looks blade template display in resources/views/errors/ directory filename same error code.

example:

in app/http/routes.php

route::get('/test', function(){    return abort(404); }); 

in resources/views/errors/ directory create 404.blade.php, notice name of file corresponds abort(404);

reference: https://laravel.com/docs/5.2/errors#http-exceptions


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -