From a0b9714d72353d6a2acbebc622b15c072ca3fbc4 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 3 Dec 2024 20:15:19 +0000 Subject: [PATCH] Updated user_id to created_by Signed-off-by: snipe --- app/Http/Controllers/Api/LocationsController.php | 2 +- app/Models/AccessoryCheckout.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Api/LocationsController.php b/app/Http/Controllers/Api/LocationsController.php index c716f86cbc..054d7b6610 100644 --- a/app/Http/Controllers/Api/LocationsController.php +++ b/app/Http/Controllers/Api/LocationsController.php @@ -245,7 +245,7 @@ class LocationsController extends Controller { $this->authorize('view', Accessory::class); $this->authorize('view', $location); - $accessory_checkouts = AccessoryCheckout::LocationAssigned()->with('admin')->with('accessories')->where('assigned_to', '=', $location->id); + $accessory_checkouts = AccessoryCheckout::LocationAssigned()->with('adminuser')->with('accessories')->where('assigned_to', '=', $location->id); $offset = ($request->input('offset') > $accessory_checkouts->count()) ? $accessory_checkouts->count() : app('api_offset_value'); $limit = app('api_limit_value'); diff --git a/app/Models/AccessoryCheckout.php b/app/Models/AccessoryCheckout.php index 86a4a26f80..2dc51160ae 100755 --- a/app/Models/AccessoryCheckout.php +++ b/app/Models/AccessoryCheckout.php @@ -23,7 +23,6 @@ class AccessoryCheckout extends Model use Searchable; protected $fillable = [ - 'user_id', 'accessory_id', 'assigned_to', 'assigned_type', @@ -58,7 +57,7 @@ class AccessoryCheckout extends Model */ public function adminuser() { - return $this->hasOne(\App\Models\User::class, 'user_id'); + return $this->hasOne(\App\Models\User::class, 'created_by'); } /**