'' ]; protected $casts = [ 'active' => 'boolean', ]; public function categories() { return $this->belongsToMany(Category::class, ProductCategory::class)->withTimestamps(); } public function description() { return $this->hasOne(ProductDescription::class)->where('locale', locale()); } public function descriptions() { return $this->hasMany(ProductDescription::class); } public function skus() { return $this->hasMany(ProductSku::class); } public function getPriceFormattedAttribute(): string { return '$' . $this->price; } public function getVariablesDecodedAttribute() { return json_decode($this->variables, true); } }