ok

Mini Shell

Direktori : /home2/selectio/www/limpiar.in.net/updates/app/Http/Resources/V2/Seller/
Upload File :
Current File : /home2/selectio/www/limpiar.in.net/updates/app/Http/Resources/V2/Seller/OrderItemResource.php

<?php

namespace App\Http\Resources\V2\Seller;

use Illuminate\Http\Resources\Json\JsonResource;

class OrderItemResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
     */
    public function toArray($request)
    {
        $description = $this->quantity;
        if($this->variation) {
            $description = $this->quantity. ' x '. $this->variation;
        }
        return [
            'name' => optional($this->product)->name,
            'description' => $description,
            'delivery_status' => $this->delivery_status,
            'price' => format_price($this->price),
        ];

    
    }
}

Zerion Mini Shell 1.0