|
@@ -18,7 +18,8 @@ public function toArray(Request $request): array
|
|
|
'cpf' => $this->cpf,
|
|
'cpf' => $this->cpf,
|
|
|
'email' => $this->email,
|
|
'email' => $this->email,
|
|
|
'language' => $this->language,
|
|
'language' => $this->language,
|
|
|
- 'user_type' => $this->user_type,
|
|
|
|
|
|
|
+ 'user_type' => $this->user_type,
|
|
|
|
|
+ 'user_type_label' => $this->user_type?->label(),
|
|
|
'status' => $this->status,
|
|
'status' => $this->status,
|
|
|
'state_id' => $this->state_id,
|
|
'state_id' => $this->state_id,
|
|
|
'unit_id' => $this->whenLoaded('units', fn() => $this->units->first()?->id),
|
|
'unit_id' => $this->whenLoaded('units', fn() => $this->units->first()?->id),
|
|
@@ -28,8 +29,8 @@ public function toArray(Request $request): array
|
|
|
'last_login_at' => $this->last_login_at
|
|
'last_login_at' => $this->last_login_at
|
|
|
? Carbon::parse($this->last_login_at)->format('Y-m-d H:i:s')
|
|
? Carbon::parse($this->last_login_at)->format('Y-m-d H:i:s')
|
|
|
: null,
|
|
: null,
|
|
|
- 'created_at' => Carbon::parse($this->created_at)->format('Y-m-d H:i:s'),
|
|
|
|
|
- 'updated_at' => Carbon::parse($this->updated_at)->format('Y-m-d H:i:s'),
|
|
|
|
|
|
|
+ 'created_at' => Carbon::parse($this->created_at)->format('Y-m-d'),
|
|
|
|
|
+ 'updated_at' => Carbon::parse($this->updated_at)->format('Y-m-d'),
|
|
|
|
|
|
|
|
'state' => $this->whenLoaded('state', fn() => [
|
|
'state' => $this->whenLoaded('state', fn() => [
|
|
|
'id' => $this->state->id,
|
|
'id' => $this->state->id,
|