*/ protected $fillable = [ 'physical_item_id', 'supplier_id', 'count', 'price', 'bought', 'description', 'replacements', 'stockLocation', 'country_of_origin_id', 'created_by', 'updated_by' ]; /** * The attributes that should be cast. * * @var array */ protected $casts = [ 'bought' => 'date', ]; /** * Get the physical item that owns the stock entry. */ public function physicalItem(): BelongsTo { return $this->belongsTo(PhysicalItem::class); } /** * Get the supplier that owns the stock entry. */ public function supplier(): BelongsTo { return $this->belongsTo(Supplier::class); } }