A free open source IT asset/license management system
Eager load adminuser method
snipe40c31a1ad7fd
diff --git a/app/Http/Controllers/Api/LocationsController.php b/app/Http/Controllers/Api/LocationsController.phpindex 66a68f9458..b5c911a6ca 100644--- a/app/Http/Controllers/Api/LocationsController.php+++ b/app/Http/Controllers/Api/LocationsController.php@@ -87,7 +87,8 @@ class LocationsController extends Controller->withCount('accessories as accessories_count')->withCount('rtd_assets as rtd_assets_count')->withCount('children as children_count')- ->withCount('users as users_count');+ ->withCount('users as users_count')+ ->with('adminuser');// Only scope locations if the setting is enabledif (Setting::getSettings()->scope_locations_fmcs) {diff --git a/app/Http/Controllers/Api/SuppliersController.php b/app/Http/Controllers/Api/SuppliersController.phpindex f752f22241..10efd923b6 100644--- a/app/Http/Controllers/Api/SuppliersController.php+++ b/app/Http/Controllers/Api/SuppliersController.php@@ -39,15 +39,17 @@ class SuppliersController extends Controller'components_count','consumables_count','url',+ 'notes',];$suppliers = Supplier::select(- ['id', 'name', 'address', 'address2', 'city', 'state', 'country', 'fax', 'phone', 'email', 'contact', 'created_at', 'updated_at', 'deleted_at', 'image', 'notes', 'url'])+ ['id', 'name', 'address', 'address2', 'city', 'state', 'country', 'fax', 'phone', 'email', 'contact', 'created_at', 'created_by', 'updated_at', 'deleted_at', 'image', 'notes', 'url'])->withCount('assets as assets_count')->withCount('licenses as licenses_count')->withCount('accessories as accessories_count')->withCount('components as components_count')- ->withCount('consumables as consumables_count');+ ->withCount('consumables as consumables_count')+ ->with('adminuser');if ($request->filled('search')) {