'boolean', ]; } public function participants(): HasMany { return $this->hasMany(Participant::class); } public function messages(): HasMany { return $this->hasMany(Message::class); } public function latestMessage(): \Illuminate\Database\Eloquent\Relations\HasOne { return $this->hasOne(Message::class)->latestOfMany(); } public function users(): BelongsToMany { return $this->belongsToMany(User::class, 'participants') ->withTimestamps() ->using(Participant::class); // Optional, but links the pivot back to Participant model if needed. } }