mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
35 lines
888 B
PHP
35 lines
888 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
|
|
use App\Models\Company;
|
|
use App\Models\Address;
|
|
use App\Models\Currency;
|
|
use App\Models\OrderStep;
|
|
use App\Models\SegmentConstant;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class OrderResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'reference' => $this->reference,
|
|
'reference_contract' => (int) $this->type,
|
|
'type' => (int) $this->type,
|
|
'status' => (int) $this->status,
|
|
'current_step' => $this->current_step,
|
|
'company' => new CompanyResource($this->companyModule->company),
|
|
'address' => new AddressResource($this->address)
|
|
];
|
|
}
|
|
}
|