$this->id, 'name' => $this->name, 'cpf' => $this->cpf, 'email' => $this->email, 'language' => $this->language, 'user_type' => $this->user_type, 'status' => $this->status, 'state_id' => $this->state_id, 'avatar_url' => $this->avatar_url ? Storage::temporaryUrl($this->avatar_url, now()->addHours(24)) : null, 'last_login_at' => $this->last_login_at ? Carbon::parse($this->last_login_at)->format('Y-m-d H:i:s') : 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'), 'state' => $this->whenLoaded('state', fn() => [ 'id' => $this->state->id, 'name' => $this->state->name, 'code' => $this->state->code, ]), ]; } public static function collection($resource): AnonymousResourceCollection { return parent::collection($resource); } }