feat: add ticket fields to Product and ProductVariant models, requests, and resources
This commit is contained in:
@@ -26,6 +26,7 @@ class ProductResource extends JsonResource
|
||||
'precio' => $this->precio,
|
||||
'category' => $this->whenLoaded('category', fn () => $this->category?->nombre),
|
||||
'brand' => $this->whenLoaded('brand', fn () => $this->brand?->nombre),
|
||||
|
||||
'images' => $this->whenLoaded('attachments', fn () => $this->attachments
|
||||
->map(fn ($attachment) => $attachment->getTemporaryUrl(1440))
|
||||
->values()
|
||||
|
||||
@@ -19,6 +19,9 @@ class ProductVariantResource extends JsonResource
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'cantidad_maxima' => $this->stock_tecnico,
|
||||
'has_tickets' => $this->has_tickets,
|
||||
'minimum_use_date' => $this->minimum_use_date,
|
||||
'maximum_use_date' => $this->maximum_use_date,
|
||||
'product' => ProductResource::make($this->whenLoaded('product')),
|
||||
'definitions' => $this->whenLoaded(
|
||||
'definitions',
|
||||
|
||||
Reference in New Issue
Block a user