mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Detach associated pivot records
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
e123eeea9e
commit
b10441c928
|
@ -182,6 +182,7 @@ class ConsumablesController extends Controller
|
|||
return redirect()->route('consumables.index')->with('error', trans('admin/consumables/message.not_found'));
|
||||
}
|
||||
$this->authorize($consumable);
|
||||
$consumable->users()->detach();
|
||||
$consumable->delete();
|
||||
// Redirect to the locations management page
|
||||
return redirect()->route('consumables.index')->with('success', trans('admin/consumables/message.delete.success'));
|
||||
|
|
Loading…
Reference in a new issue