Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| ShippingPackagingProductResource | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| toArray | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Domain\ShippingPackaging\Resources; |
| 4 | |
| 5 | use Domain\PickingOrder\Resources\PickedItemResource; |
| 6 | use Illuminate\Http\Request; |
| 7 | use Illuminate\Http\Resources\Json\JsonResource; |
| 8 | |
| 9 | /** |
| 10 | * @property int $id |
| 11 | * @property int $amount |
| 12 | * @property string $created_at |
| 13 | * @property string $updated_at |
| 14 | */ |
| 15 | class ShippingPackagingProductResource extends JsonResource |
| 16 | { |
| 17 | |
| 18 | public function toArray(Request $request): array |
| 19 | { |
| 20 | return [ |
| 21 | 'id' => $this->id, |
| 22 | 'amount' => $this->amount, |
| 23 | 'picked_item' => PickedItemResource::make($this->whenLoaded('pickedItem')), |
| 24 | 'shipping_packaging_product' => ShippingPackagingResource::make($this->whenLoaded('shipping_packaging_product')), |
| 25 | 'created_at' => (string)$this->created_at, |
| 26 | 'updated_at' => (string)$this->updated_at, |
| 27 | ]; |
| 28 | } |
| 29 | } |