From 44f7305e12e45b9d5b7d0315361a63469a57c434 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 21 Apr 2016 21:01:57 -0700 Subject: [PATCH] Fix restore assets --- app/Http/Controllers/AssetsController.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/AssetsController.php b/app/Http/Controllers/AssetsController.php index 3e30233f9d..49cd286306 100755 --- a/app/Http/Controllers/AssetsController.php +++ b/app/Http/Controllers/AssetsController.php @@ -911,14 +911,9 @@ class AssetsController extends Controller return Redirect::to('hardware')->with('error', trans('general.insufficient_permissions')); } elseif (isset($asset->id)) { - // Restore the user - $asset->restore(); - - // Prepare the success message - $success = trans('admin/hardware/message.restore.success'); - - // Redirect to the user management page - return Redirect::route('hardware')->with('success', $success); + // Restore the asset + Asset::withTrashed()->where('id',$assetId)->restore(); + return Redirect::route('hardware')->with('success', trans('admin/hardware/message.restore.success')); } else { return Redirect::to('hardware')->with('error', trans('admin/hardware/message.does_not_exist'));