From 6e270c0ed2fb725a0fee9369c9cc85cd7c18d2fc Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 23 Sep 2021 17:23:17 -0700 Subject: [PATCH] Include created_at in pivot Signed-off-by: snipe --- app/Models/Asset.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index fa506de7d9..bff0134a05 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -376,7 +376,7 @@ class Asset extends Depreciable */ public function components() { - return $this->belongsToMany('\App\Models\Component', 'components_assets', 'asset_id', 'component_id')->withPivot('id', 'assigned_qty')->withTrashed(); + return $this->belongsToMany('\App\Models\Component', 'components_assets', 'asset_id', 'component_id')->withPivot('id', 'assigned_qty', 'created_at')->withTrashed(); }