A free open source IT asset/license management system
Fixed compact() errors
snipe0b3f511534b7
diff --git a/app/Http/Controllers/AccessoriesController.php b/app/Http/Controllers/AccessoriesController.phpindex 36e8a99212..d70de63630 100755--- a/app/Http/Controllers/AccessoriesController.php+++ b/app/Http/Controllers/AccessoriesController.php@@ -198,7 +198,7 @@ class AccessoriesController extends Controllerif (isset($accessory->id)) {return view('accessories/view', compact('accessory'));}- return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist', compact('id')));+ return redirect()->route('accessories.index')->with('error', trans('admin/accessories/message.does_not_exist'));}/**diff --git a/app/Http/Controllers/AssetModelsController.php b/app/Http/Controllers/AssetModelsController.phpindex 7c3531e475..536a951660 100755--- a/app/Http/Controllers/AssetModelsController.php+++ b/app/Http/Controllers/AssetModelsController.php@@ -259,11 +259,8 @@ class AssetModelsController extends Controllerif (isset($model->id)) {return view('models/view', compact('model'));}- // Prepare the error message- $error = trans('admin/models/message.does_not_exist', compact('id'));- // Redirect to the user management page- return redirect()->route('models.index')->with('error', $error);+ return redirect()->route('models.index')->with('error', trans('admin/models/message.does_not_exist'));}/**diff --git a/app/Http/Controllers/CategoriesController.php b/app/Http/Controllers/CategoriesController.phpindex f57ec2b4c2..a2f33ebb0a 100755--- a/app/Http/Controllers/CategoriesController.php+++ b/app/Http/Controllers/CategoriesController.php@@ -219,10 +219,7 @@ class CategoriesController extends Controller->with('category_type_route',$category_type_route);}- // Prepare the error message- $error = trans('admin/categories/message.does_not_exist', compact('id'));- // Redirect to the user management page- return redirect()->route('categories.index')->with('error', $error);+ return redirect()->route('categories.index')->with('error', trans('admin/categories/message.does_not_exist'));}diff --git a/app/Http/Controllers/ComponentsController.php b/app/Http/Controllers/ComponentsController.phpindex f4106b420d..4bd7ec97c3 100644--- a/app/Http/Controllers/ComponentsController.php+++ b/app/Http/Controllers/ComponentsController.php@@ -199,10 +199,8 @@ class ComponentsController extends Controller$this->authorize('view', $component);return view('components/view', compact('component'));}- // Prepare the error message- $error = trans('admin/components/message.does_not_exist', compact('id'));- // Redirect to the user management page- return redirect()->route('components.index')->with('error', $error);++ return redirect()->route('components.index')->with('error', trans('admin/components/message.does_not_exist'));}/**diff --git a/app/Http/Controllers/DepartmentsController.php b/app/Http/Controllers/DepartmentsController.phpindex 965c98b4fa..c0788ee65a 100644--- a/app/Http/Controllers/DepartmentsController.php+++ b/app/Http/Controllers/DepartmentsController.php@@ -79,7 +79,7 @@ class DepartmentsController extends Controllerif (isset($department->id)) {return view('departments/view', compact('department'));}- return redirect()->route('departments.index')->with('error', trans('admin/departments/message.does_not_exist', compact('id')));+ return redirect()->route('departments.index')->with('error', trans('admin/departments/message.does_not_exist'));}diff --git a/app/Http/Controllers/LicensesController.php b/app/Http/Controllers/LicensesController.phpindex 5caacbdd26..5bae86fc77 100755--- a/app/Http/Controllers/LicensesController.php+++ b/app/Http/Controllers/LicensesController.php@@ -455,7 +455,7 @@ class LicensesController extends Controller$this->authorize('view', $license);return view('licenses/view', compact('license'));}- return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.does_not_exist', compact('id')));+ return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.does_not_exist'));}@@ -524,9 +524,8 @@ class LicensesController extends Controller}return redirect()->route('licenses.show', $license->id)->with('error', trans('admin/licenses/message.upload.nofiles'));}- // Prepare the error message- $error = trans('admin/licenses/message.does_not_exist', compact('id'));- return redirect()->route('licenses.index')->with('error', $error);++ return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.does_not_exist'));}@@ -562,7 +561,7 @@ class LicensesController extends Controller}// Redirect to the licence management page- return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.does_not_exist', compact('id')));+ return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.does_not_exist'));}@@ -613,7 +612,7 @@ class LicensesController extends Controller}- return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.does_not_exist', compact('id')));+ return redirect()->route('licenses.index')->with('error', trans('admin/licenses/message.does_not_exist'));}diff --git a/app/Http/Controllers/LocationsController.php b/app/Http/Controllers/LocationsController.phpindex d31b8a13bf..c5c5e8d3a0 100755--- a/app/Http/Controllers/LocationsController.php+++ b/app/Http/Controllers/LocationsController.php@@ -213,7 +213,7 @@ class LocationsController extends Controllerreturn view('locations/view', compact('location'));}- return redirect()->route('locations.index')->with('error', trans('admin/locations/message.does_not_exist', compact('id')));+ return redirect()->route('locations.index')->with('error', trans('admin/locations/message.does_not_exist'));}}diff --git a/app/Http/Controllers/StatuslabelsController.php b/app/Http/Controllers/StatuslabelsController.phpindex b1b743e772..7cc48f08fe 100755--- a/app/Http/Controllers/StatuslabelsController.php+++ b/app/Http/Controllers/StatuslabelsController.php@@ -43,7 +43,7 @@ class StatuslabelsController extends Controllerreturn view('statuslabels.view')->with('statuslabel', $statuslabel);}- return redirect()->route('statuslabels.index')->with('error', trans('admin/statuslabels/message.does_not_exist', compact('id')));+ return redirect()->route('statuslabels.index')->with('error', trans('admin/statuslabels/message.does_not_exist'));}diff --git a/app/Http/Controllers/SuppliersController.php b/app/Http/Controllers/SuppliersController.phpindex bc7934abc2..e5798353c0 100755--- a/app/Http/Controllers/SuppliersController.php+++ b/app/Http/Controllers/SuppliersController.php@@ -195,11 +195,8 @@ class SuppliersController extends Controllerif (isset($supplier->id)) {return view('suppliers/view', compact('supplier'));}- // Prepare the error message- $error = trans('admin/suppliers/message.does_not_exist', compact('id'));- // Redirect to the user management page- return redirect()->route('suppliers.index')->with('error', $error);+ return redirect()->route('suppliers.index')->with('error', trans('admin/suppliers/message.does_not_exist'));}}diff --git a/app/Http/Controllers/UsersController.php b/app/Http/Controllers/UsersController.phpindex f1c2ebda55..ebd68b0ec1 100755--- a/app/Http/Controllers/UsersController.php+++ b/app/Http/Controllers/UsersController.php@@ -606,10 +606,12 @@ class UsersController extends Controller*/public function show($userId = null){- if(!$user = User::with('assets', 'assets.model', 'consumables', 'accessories', 'licenses', 'userloc')->withTrashed()->find($userId)) {- $error = trans('admin/users/message.user_not_found', compact('id'));- // Redirect to the user management page- return redirect()->route('users.index')->with('error', $error);+ if (!$user = User::with('assets', 'assets.model', 'consumables', 'accessories', 'licenses', 'userloc')+ ->withTrashed()+ ->find($userId))+ {++ return redirect()->route('users.index')->with('error', trans('admin/users/message.user_not_found', ['id' => $userId]));}$userlog = $user->userlog->load('item');@@ -706,10 +708,8 @@ class UsersController extends Controller->with('userGroups', $userGroups)->with('clone_user', $user_to_clone);} catch (UserNotFoundException $e) {- // Prepare the error message- $error = trans('admin/users/message.user_not_found', compact('id'));- // Redirect to the user management page- return redirect()->route('users.index')->with('error', $error);++ return redirect()->route('users.index')->with('error', trans('admin/users/message.user_not_found'));}}@@ -790,10 +790,8 @@ class UsersController extends Controller$log->delete();return redirect()->back()->with('success', trans('admin/users/message.deletefile.success'));}- // Prepare the error message- $error = trans('admin/users/message.does_not_exist', compact('id'));- // Redirect to the licence management page- return redirect()->route('users.index')->with('error', $error);++ return redirect()->route('users.index')->with('error', trans('admin/users/message.does_not_exist'));}