parent
							
								
									d5cd9f4096
								
							
						
					
					
						commit
						78c197549d
					
				@ -0,0 +1,19 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace App\Http\Resources\API\v2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use Illuminate\Http\Request;
 | 
				
			||||||
 | 
					use Illuminate\Http\Resources\Json\ResourceCollection;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class CartItemCollection extends ResourceCollection
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Transform the resource collection into an array.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @return array<int|string, mixed>
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function toArray(Request $request): array
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return parent::toArray($request);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,28 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace App\Http\Resources\API\v2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use Illuminate\Http\Request;
 | 
				
			||||||
 | 
					use Illuminate\Http\Resources\Json\JsonResource;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class CartItemResource extends JsonResource
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Transform the resource into an array.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @return array<string, mixed>
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function toArray(Request $request): array
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        return [
 | 
				
			||||||
 | 
					            'id' => $this->id,
 | 
				
			||||||
 | 
					            'uuid' => $this->uuid,
 | 
				
			||||||
 | 
					            'name' => $this->name,
 | 
				
			||||||
 | 
					            'url' => $this->url,
 | 
				
			||||||
 | 
					            'description' => $this->description,
 | 
				
			||||||
 | 
					            'price' => $this->price,
 | 
				
			||||||
 | 
					            'image' => $this->image,
 | 
				
			||||||
 | 
					            'count' => $this->count,
 | 
				
			||||||
 | 
					        ];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
					Loading…
					
					
				
		Reference in new issue