Add status to product resource

This commit is contained in:
Amanmyrat 2023-09-05 17:27:04 +05:00
parent c929bfe9d5
commit 6f954cdb94
1 changed files with 5 additions and 3 deletions

View File

@ -37,7 +37,7 @@ class Product extends JsonResource
return [
/* product's information */
'id' => $product->id,
// 'sku' => $product->sku,
'sku' => $product->sku,
'type' => $product->type,
'name' => $product->name,
'categories' => $product->categories,
@ -51,10 +51,12 @@ class Product extends JsonResource
'in_stock' => $product->haveSufficientQuantity(1),
'is_wishlisted' => $this->isWishlisted($product) ,
'is_item_in_cart' => \Cart::hasProduct($product),
'shop_title' => $this->shop_title,
'logo' => $this->logo ? Storage::url($this->logo) : null,
//'shop_title' => $this->shop_title,
//'logo' => $this->logo ? Storage::url($this->logo) : null,
'new' => $this->new,
'featured' => $this->featured,
'qty' => $this->qty,
'status' => $this->status,
// 'brand' => $product->brand->name ?? '',