Skip to content

A free open source IT asset/license management system

Updated user_id to created_by

snipea0b9714d7235
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');
}
/**