php - Show a 404 page if route not found in Laravel 5.1 -
i trying figure out show 404 page not found if route not found. followed many tutorials, doesn't work. have 404.blade.php
in \laravel\resources\views\errors
also in handler.php
public function render($request, exception $e) { if ($e instanceof tokenmismatchexception) { // redirect form example of how handle mine return redirect($request->fullurl())->with( 'csrf_error', "opps! seems couldn't submit form longtime. please try again" ); } /*if ($e instanceof customexception) { return response()->view('errors.404', [], 500); }*/ if ($e instanceof \symfony\component\httpkernel\exception\notfoundhttpexception) return response(view('error.404'), 404); return parent::render($request, $e); }
if enter wrong url in browser, returns blank page. have
'debug' => env('app_debug', true),
in app.php.
can me how show 404 page if route not found? thank you.
@tester.you problem solved still saying work in new project not in working project.for try below command in composer like
php artisan view:clear
then try once unknown url .because same error faced before
Comments
Post a Comment