33 lines
1.2 KiB
PHP
33 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class BrokerApplicationResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'broker_application_id' => $this->id,
|
|
'is_local' => $this->is_local ?? true,
|
|
'state' => $this->state,
|
|
'accepted_by' => $this->accepted_by,
|
|
'accepted_date' => $this->accepted_date,
|
|
'approved_by' => $this->approved_by,
|
|
'refine_note' => $this->refine_note,
|
|
'approved_date' => $this->approved_date,
|
|
'questionnaire_path' => $this->questionnaire_path,
|
|
'receipt_path' => $this->receipt_path,
|
|
'broker_attachments' => BrokerAttachmentResource::collection($this->broker_attachments),
|
|
'ticket' => TicketResource::make($this->ticket),
|
|
];
|
|
}
|
|
}
|