redirect to 404 page automatically at laravel 5.4 redirect to 404 page automatically at laravel 5.4 php php

redirect to 404 page automatically at laravel 5.4


just add abort method

 return abort(404);

it's automatically redirect to your resources/views/errors/404.blade.php


return abort(404);

and set your routes too for this particular action/method with get request.


In addition, you may provide the response text:

return abort(403, 'Unauthorized action.');