Check that the user was not aready deleted

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-06-05 14:00:35 +01:00
parent d4c080c7e4
commit 5cdb2b7163

View file

@ -341,8 +341,7 @@ class UsersController extends Controller
$user = User::with('assets', 'assets.model', 'consumables', 'accessories', 'licenses', 'userloc');
$user = Company::scopeCompanyables($user)->find($id);
if ($user) {
if (($user) && ($user->deleted_at = '')) {
// Delete the user
$user->delete();
return redirect()->route('users.index')->with('success', trans('admin/users/message.success.delete'));