mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Redirect to /dashboard on model not found
This commit is contained in:
parent
04bbb0ff6f
commit
a8d73fe1f2
@ -40,13 +40,9 @@ class EntityRequest extends Request
|
||||
}
|
||||
|
||||
if (method_exists($class, 'trashed')) {
|
||||
$this->entity = $class::scope($publicId)->withTrashed()->first();
|
||||
$this->entity = $class::scope($publicId)->withTrashed()->firstOrFail();
|
||||
} else {
|
||||
$this->entity = $class::scope($publicId)->first();
|
||||
}
|
||||
|
||||
if (! $this->entity) {
|
||||
abort(404, "Entity: {$class} Id: {$publicId} not found");
|
||||
$this->entity = $class::scope($publicId)->firstOrFail();
|
||||
}
|
||||
|
||||
return $this->entity;
|
||||
|
Loading…
x
Reference in New Issue
Block a user