'datetime', 'started_at' => 'datetime', 'ended_at' => 'datetime', 'team_attendees' => 'array', 'client_emails' => 'array', 'active_peers' => 'array', 'peer_signals' => 'array', 'chat_messages' => 'array', 'recordings' => 'array', ]; /** * The parent client profile. */ public function client() { return $this->belongsTo(Client::class, 'client_id'); } /** * Host user who organized the call. */ public function host() { return $this->belongsTo(User::class, 'host_user_id'); } /** * Notes and MoM entries for this meeting. */ public function callNotes() { return $this->hasMany(ClientCallNote::class, 'client_meeting_id')->orderBy('created_at', 'desc'); } /** * Latest call note or MoM. */ public function latestNote() { return $this->hasOne(ClientCallNote::class, 'client_meeting_id')->latestOfMany(); } /** * Get assigned team attendees User models. */ public function getTeamAttendees() { if (empty($this->team_attendees)) { return collect(); } return User::whereIn('id', $this->team_attendees)->get(); } /** * Helper to get shareable join URL. */ public function getJoinUrlAttribute(): string { return route('client-calls.room', ['code' => $this->meeting_code]); } }