File "PurchaseOrderResource.php"

Full Path: /home/clickysoft/public_html/jmapi5.clickysoft.net/app/Http/Resources/Admin/PurchaseOrderResource.php
File size: 902 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

namespace App\Http\Resources\Admin;

use Illuminate\Http\Resources\Json\JsonResource;

class PurchaseOrderResource extends JsonResource
{
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'order_number' => $this->order_number,
            'ordered_by' => $this->user?->name,
            'vendor' => $this->vendor?->name,
            'payment_terms' => $this->payment_terms,
            'reference' => $this->reference,
            'shipping_address' => $this->shipping_address,
            'billing_address' => $this->billing_address,
            'total_quantity' => $this->total_quantity,
            'stock_location' => $this->location?->location,
            'total_price' => '$'.number_format($this->total_price, 2),
            'status' => $this->status,
            'create_at' => $this->created_at->format('m-d-Y')
        ];
    }
}