HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/rentman2019.komma.pro/app/Komma/Shop/Orders/Resources/OrderedProduct.php
<?php

namespace App\Komma\Shop\Orders\Resources;

use App\Komma\Shop\Products\Product\ProductResource;
use Illuminate\Http\Resources\Json\Resource;

/**
 * Class OrderedProduct
 *
 * @see \App\Komma\Shop\Orders\Product\OrderedProduct
 */
class OrderedProduct extends Resource
{
    /**
     * Transform the resource into an array.
     *
     * @param \Illuminate\Http\Request $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'active' => $this->active,
            'price' => $this->price,
            'stock_keeping_unit' => $this->stock_keeping_unit,
            'video' => $this->video,
            'quantity' => $this->quantity,
            'discount' => $this->discount,
            'product' => $this->whenLoaded('product', new ProductResource($this->product)),
        ];
    }
}