JsonArray::class, 'sell_price' => Price::class, 'market_price' => Price::class, 'cost_price' => Price::class, 'vip_price' => Price::class, 'attrs' => JsonArray::class, 'release_at' => 'datetime', ]; /** * @var array */ protected $fillable = [ 'name', 'subtitle', 'category_id', 'codcovere', 'images', 'sell_price', 'market_price', 'cost_price', 'vip_price', 'media', 'weight', 'attrs', 'stock', 'sales', 'release_at', ]; public function specs() { return $this->hasMany(ProductSpuSpec::class, 'product_spu_id'); } public function features() { return $this->belongsToMany(ProductFeature::class, 'product_spu_features', 'feature_id', 'spu_id'); } }