Group
Group stores the metadata for group conversations.
The actual thread still lives in Conversation; Group adds group-specific information on top of it.
This model is a good place to add app-specific room metadata, as long as you keep the package permission flags intact.
Core fields:
| Field | Purpose |
|---|---|
conversation_id |
Parent conversation id for the group thread. |
name |
Group name. |
description |
Group description or about text. |
type |
Group type enum. |
allow_members_to_send_messages |
Permission flag for regular members. |
allow_members_to_add_others |
Permission flag for inviting others. |
allow_members_to_invite_others_via_link |
Permission flag for letting regular members copy and send the primary group invite link. |
allow_members_to_edit_group_info |
Permission flag for editing name and description. |
admins_must_approve_new_members |
Approval flag used during join flows. |
meta |
Nullable JSON metadata for display-only, integration, or rarely queried extension data. |
Important Relationships
conversation(): BelongsTo
Returns the parent conversation.
$group->conversation
cover(): MorphOne
Returns the cover attachment model when the group has one.
$group->cover
Important Accessors And Helpers
$group->cover_url
Returns the resolved URL for the cover attachment when it exists.
$group->cover_url
isOwnedBy(Model|Authenticatable $user): bool
Checks whether the given app model is the owner of the group conversation.
$group->isOwnedBy(auth()->user())
allowsMembersToSendMessages(): bool
Checks whether regular members are allowed to send messages in the group.
$group->allowsMembersToSendMessages()
allowsMembersToAddOthers(): bool
Checks whether regular members are allowed to invite other users.
$group->allowsMembersToAddOthers()
allowsMembersToEditGroupInfo(): bool
Checks whether regular members can update the group name or description.
$group->allowsMembersToEditGroupInfo()
allowsMembersToInviteOthersViaLink(): bool
Checks whether regular members can copy and send the group's primary invite link. This does not grant permission to create, reset, revoke, or manage additional invite links.
$group->allowsMembersToInviteOthersViaLink()
$group->admins_must_approve_new_members
This is a stored flag rather than a helper method and is useful when building join-request or approval flows.
$group->admins_must_approve_new_members
Typical safe customizations:
- Add organization or workspace relations.
- Add visual metadata such as themes, tags, or external ids.
- Add read-only accessors for display data.
- Preserve the permission flags and cover-cleanup behavior.