mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Add exception for hardware vs assets :(
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
560311b883
commit
fa20eb4965
|
@ -127,6 +127,11 @@ class Handler extends ExceptionHandler
|
|||
if ($e instanceof \Illuminate\Database\Eloquent\ModelNotFoundException) {
|
||||
$model_name = last(explode('\\', $e->getModel()));
|
||||
$route_base = str_plural(strtolower(last(explode('\\', $e->getModel()))));
|
||||
|
||||
// Sigh. Fucking laravel.
|
||||
if ($route_base =='assets') {
|
||||
$route_base = 'hardware';
|
||||
}
|
||||
return redirect()
|
||||
->route($route_base.'.index')
|
||||
->withError(trans('general.generic_model_not_found', ['model' => $model_name]));
|
||||
|
|
Loading…
Reference in a new issue