Missing model record show message and redirect index page..
This commit is contained in:
parent
5e7f8faeba
commit
777e1d15d6
@ -100,9 +100,20 @@ class Handler extends ExceptionHandler
|
|||||||
return response()->json(['error' => 'Not Found'], 404);
|
return response()->json(['error' => 'Not Found'], 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$names = explode('.', $request->route()->getName());
|
||||||
|
$names[count($names) - 1] = 'index';
|
||||||
|
|
||||||
|
$route = route(implode('.', $names));
|
||||||
|
|
||||||
|
flash(trans('errors.message.record'))->warning()->important();
|
||||||
|
|
||||||
|
return redirect($route);
|
||||||
|
} catch (\Exception $e) {
|
||||||
// normal 404 view page feedback
|
// normal 404 view page feedback
|
||||||
return response()->view('errors.404', [], 404);
|
return response()->view('errors.404', [], 404);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($exception instanceof FatalThrowableError) {
|
if ($exception instanceof FatalThrowableError) {
|
||||||
// ajax 500 json feedback
|
// ajax 500 json feedback
|
||||||
|
@ -18,6 +18,7 @@ return [
|
|||||||
'403' => 'You can not access this page.',
|
'403' => 'You can not access this page.',
|
||||||
'404' => 'We could not find the page you were looking for.',
|
'404' => 'We could not find the page you were looking for.',
|
||||||
'500' => 'We will work on fixing that right away.',
|
'500' => 'We will work on fixing that right away.',
|
||||||
|
'record' => 'We could not find the record you were looking for.',
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user