From ea1b792a93fe66ae78953ea8741b8ce9cd17e76a Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 12 Dec 2018 18:23:39 -0800 Subject: [PATCH] Fixed #6491 - cleaner return methods for PHP 7.3 compact() --- app/Http/Controllers/CompaniesController.php | 2 +- app/Http/Controllers/DepreciationsController.php | 2 +- app/Http/Controllers/GroupsController.php | 2 +- app/Http/Controllers/LocationsController.php | 2 +- app/Http/Controllers/ManufacturersController.php | 2 +- app/Http/Controllers/StatuslabelsController.php | 2 +- app/Http/Controllers/SuppliersController.php | 3 +-- app/Http/Controllers/ViewAssetsController.php | 2 +- 8 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/CompaniesController.php b/app/Http/Controllers/CompaniesController.php index aae2975493..8d1a854720 100644 --- a/app/Http/Controllers/CompaniesController.php +++ b/app/Http/Controllers/CompaniesController.php @@ -31,7 +31,7 @@ final class CompaniesController extends Controller { $this->authorize('view', Company::class); - return view('companies/index')->with('companies', Company::all()); + return view('companies/index'); } /** diff --git a/app/Http/Controllers/DepreciationsController.php b/app/Http/Controllers/DepreciationsController.php index ececded3fe..d9f84415ee 100755 --- a/app/Http/Controllers/DepreciationsController.php +++ b/app/Http/Controllers/DepreciationsController.php @@ -34,7 +34,7 @@ class DepreciationsController extends Controller $this->authorize('view', Depreciation::class); // Show the page - return view('depreciations/index', compact('depreciations')); + return view('depreciations/index'); } diff --git a/app/Http/Controllers/GroupsController.php b/app/Http/Controllers/GroupsController.php index 8db126f6c5..c60584431b 100755 --- a/app/Http/Controllers/GroupsController.php +++ b/app/Http/Controllers/GroupsController.php @@ -31,7 +31,7 @@ class GroupsController extends Controller public function index() { // Show the page - return view('groups/index', compact('groups')); + return view('groups/index'); } /** diff --git a/app/Http/Controllers/LocationsController.php b/app/Http/Controllers/LocationsController.php index 5f3de56fb8..b67843b836 100755 --- a/app/Http/Controllers/LocationsController.php +++ b/app/Http/Controllers/LocationsController.php @@ -44,7 +44,7 @@ class LocationsController extends Controller $locations = Location::orderBy('created_at', 'DESC')->with('parent', 'assets', 'assignedassets')->get(); // Show the page - return view('locations/index', compact('locations')); + return view('locations/index'); } diff --git a/app/Http/Controllers/ManufacturersController.php b/app/Http/Controllers/ManufacturersController.php index 1d84fa37d2..686a2081fa 100755 --- a/app/Http/Controllers/ManufacturersController.php +++ b/app/Http/Controllers/ManufacturersController.php @@ -36,7 +36,7 @@ class ManufacturersController extends Controller public function index() { $this->authorize('index', Manufacturer::class); - return view('manufacturers/index', compact('manufacturers')); + return view('manufacturers/index'); } diff --git a/app/Http/Controllers/StatuslabelsController.php b/app/Http/Controllers/StatuslabelsController.php index 9c609ebb96..cb096ea35d 100755 --- a/app/Http/Controllers/StatuslabelsController.php +++ b/app/Http/Controllers/StatuslabelsController.php @@ -33,7 +33,7 @@ class StatuslabelsController extends Controller public function index() { $this->authorize('view', Statuslabel::class); - return view('statuslabels.index', compact('statuslabels')); + return view('statuslabels.index'); } public function show($id) diff --git a/app/Http/Controllers/SuppliersController.php b/app/Http/Controllers/SuppliersController.php index ce7de94f35..7666ebff4f 100755 --- a/app/Http/Controllers/SuppliersController.php +++ b/app/Http/Controllers/SuppliersController.php @@ -34,10 +34,9 @@ class SuppliersController extends Controller { // Grab all the suppliers $this->authorize('view', Supplier::class); - $suppliers = Supplier::orderBy('created_at', 'DESC')->get(); // Show the page - return view('suppliers/index', compact('suppliers')); + return view('suppliers/index'); } diff --git a/app/Http/Controllers/ViewAssetsController.php b/app/Http/Controllers/ViewAssetsController.php index af7626765e..5bf48bb8b0 100755 --- a/app/Http/Controllers/ViewAssetsController.php +++ b/app/Http/Controllers/ViewAssetsController.php @@ -73,7 +73,7 @@ class ViewAssetsController extends Controller $assets = Asset::with('model', 'defaultLoc', 'location', 'assignedTo', 'requests')->Hardware()->RequestableAssets()->get(); $models = AssetModel::with('category', 'requests', 'assets')->RequestableModels()->get(); - return view('account/requestable-assets', compact('user', 'assets', 'models')); + return view('account/requestable-assets', compact('assets', 'models')); }