*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'client_id' => $this->client_id, 'first_name' => $this->first_name, 'last_name' => $this->last_name, 'full_name' => $this->full_name, 'email' => $this->email, 'phone' => $this->phone, 'role' => $this->role, 'created_at' => $this->created_at?->format('Y-m-d H:i:s'), 'updated_at' => $this->updated_at?->format('Y-m-d H:i:s'), // Relations 'client' => $this->whenLoaded('client', [ 'id' => $this->client->id, 'name' => $this->client->name, ]), ]; } public function with(Request $request): array { return [ 'status' => 'success', 'message' => 'Contact récupéré avec succès', ]; } }