This commit is contained in:
TL 2022-08-12 17:02:18 +08:00
parent 8eb65c3f9d
commit a6801ef182
1 changed files with 5 additions and 0 deletions

View File

@ -52,6 +52,11 @@ class Product extends Base
return $this->belongsTo(Brand::Class, 'brand_id', 'id');
}
public function inCurrentWishlist()
{
return $this->hasOne(CustomerWishlist::class)->where('customer_id', current_customer() ? current_customer()->id : 0);
}
public function getPriceFormattedAttribute(): string
{
return '$' . $this->price;