This commit is contained in:
ericli1018
2025-06-13 12:24:35 +08:00
parent 1caae33c43
commit 6dfe3e0677
74 changed files with 1497 additions and 253 deletions

View File

@ -27,7 +27,7 @@ class Product extends Model
protected $guarded = ['id'];
// protected $fillable = [];
// protected $hidden = [];
public $translatable = ['title', 'tip', 'description', 'body', 'feature_overview', 'feature_spec', 'seo_keyword', 'seo_description'];
public $translatable = ['title', 'description', 'body', 'feature_overview', 'feature_spec', 'seo_keyword', 'seo_description'];
protected $casts = [
'photos' => 'array',
];
@ -53,6 +53,11 @@ class Product extends Model
| RELATIONS
|--------------------------------------------------------------------------
*/
public function productRelateds()
{
return $this->belongsToMany(Product::class, 'product_product_related', 'product_id', 'product_related_id');
}
public function productCatalog()
{
return $this->belongsTo(ProductCatalog::class, 'product_catalog_id');