updated resource response format
This commit is contained in:
parent
8a8c9b0a7d
commit
a39812cdb3
|
|
@ -15,16 +15,20 @@ class ApplicationStatusResource extends JsonResource
|
|||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'legal_number' => $this->legalization_number,
|
||||
'legal_expires_at' => !is_null($this->expires_at)?$this->expires_at->format('d.m.Y'):null,
|
||||
'legal_can_apply' => $this->can_apply,
|
||||
'legal_can_extend' => $this->can_extend,
|
||||
'legal_app_status' => $this->application_status,
|
||||
'broker_number' => $this->broker_number,
|
||||
'broker_expires_at' => !is_null($this->broker_expires_at)?$this->broker_expires_at->format('d.m.Y'):null,
|
||||
'broker_can_apply' => $this->can_apply_broker,
|
||||
'broker_can_extend' => $this->can_extend_broker,
|
||||
'broker_app_status' => $this->application_broker_status,
|
||||
'legal' => [
|
||||
'number' => $this->legalization_number,
|
||||
'expires_at' => !is_null($this->expires_at)?$this->expires_at->format('d.m.Y'):null,
|
||||
'can_apply' => $this->can_apply,
|
||||
'can_extend' => $this->can_extend,
|
||||
'app_status' => $this->application_status,
|
||||
],
|
||||
'broker' => [
|
||||
'number' => $this->broker_number,
|
||||
'expires_at' => !is_null($this->broker_expires_at)?$this->broker_expires_at->format('d.m.Y'):null,
|
||||
'can_apply' => $this->can_apply_broker,
|
||||
'can_extend' => $this->can_extend_broker,
|
||||
'app_status' => $this->application_broker_status,
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue