Include created_at in pivot

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2021-09-23 17:23:17 -07:00
parent 6aa7e9cbfa
commit 6e270c0ed2

View file

@ -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();
}