
Social Groups for Flarum



A full-featured social groups extension for Flarum 2. Members can create public or private groups, post to a Facebook-style feed, hold threaded discussions, share media, react to posts, run polls, and more โ with optional real-time updates powered by flarum/realtime.
Features
Groups
- Public & private groups โ public groups are open to all; private groups require a join request or direct invitation.
- Group image & banner upload โ each group has its own avatar and cover banner image.
- Featured groups โ administrators can pin groups to a featured row on the group directory.
- Primary group badge โ members designate one group as their primary group; the badge is displayed on their Flarum profile.
- Group analytics dashboard โ overview of member count, post activity, and growth over time (visible to group admins and moderators).
- RSS feed โ each group exposes a per-group RSS 2.0 feed at
/groups/{slug}/feed.rss.
Feed
- Facebook-style post cards with full Flarum BBCode/Markdown rendering.
- Emoji reactions โ six reaction types: ๐ Like, โค๏ธ Love, ๐ Haha, ๐ฎ Wow, ๐ข Sad, ๐ก Angry; one reaction per user, toggleable.
- Polls โ create polls directly from the post composer; members vote inline with live percentage bars.
- Link previews โ URLs are automatically expanded into rich Open Graph preview cards (title, description, thumbnail).
- Media attachments โ attach images and files to posts via
fof/upload (optional).
- Pin posts โ group admins can pin discussions to the top of the feed.
- Post search โ debounced search bar filters discussions by title or content in real time.
- Post sharing โ share any discussion into another group you belong to, with an optional comment; shared posts render a quoted card.
Discussions
- Threaded discussion view at
/groups/{slug}/d/{discussionId} with nested comment replies.
- Pin discussions to the top of the discussion list.
- Share discussions to the group feed.
Media Gallery
- Dedicated "Media" tab on each group page aggregating all images from posts and discussions into a responsive thumbnail grid with lightbox.
Member Management
- Join requests โ group admins approve or reject membership requests; direct invitations bypass the queue.
- Promote / demote โ elevate a member to group admin or step them back down.
- Kick โ remove a member from the group.
- Member badges on profiles โ group membership chips appear on Flarum user profile cards forum-wide.
Notifications
- Alert when a new post is created in a group the user participates in.
- Alert when someone replies directly to a user's post.
Real-time (optional โ requires flarum/realtime)
See the flarum/realtime Integration section below.
Requirements
| Dependency | Version | Required |
|---|---|---|
| Flarum | 2.x | Yes |
| PHP | 8.3+ | Yes |
| flarum/realtime | any | No โ graceful no-op if absent |
| fof/upload | 2.0 | No โ required for file/image attachments in posts |
Installation
composer require ernestdefoe/social-groups
php flarum migrate
php flarum cache:clear
Then go to Admin โ Extensions and enable Social Groups.
After every update, run the migrate and cache-clear commands to apply any new database migrations:
php flarum migrate && php flarum cache:clear
Configuration
Admin panel settings
Navigate to Admin โ Extensions โ Social Groups:
| Setting | Options | Default |
|---|---|---|
| Who can create groups | member โ any registered user; admin โ forum administrators only | member |
Group privacy
Group creators choose privacy at creation time:
| Type | Behaviour |
|---|---|
| Public | Anyone can view the feed, discussions, and gallery. Joining is instant. |
| Private | Content is hidden from non-members. New members must submit a join request (approved by a group admin) or be invited directly. |
flarum/realtime Integration
The real-time features are entirely optional. If flarum/realtime is not installed the extension works normally โ the typing endpoint silently returns 204 and the post-broadcast listener exits immediately without any error or warning.
When flarum/realtime is installed and running:
- Live post injection โ after a member submits a reply in a group discussion thread, all other members viewing that thread see the new post card appear instantly via the
sg-post-created WebSocket event. No page refresh is needed.
- Typing indicator โ while a member is composing a reply, an animated "Jane is typingโฆ" indicator with bouncing dots is broadcast via the
sg-typing event and displayed above the reply box for all other members viewing the same thread. The indicator disappears automatically when the member stops typing or submits their post.
- Deduplication โ the client compares each incoming post's ID against already-rendered posts to prevent duplicates when both the HTTP response and the WebSocket push arrive for the same post.
- No extra configuration โ the extension uses the existing public Pusher/Soketi channel that
flarum/realtime sets up. Nothing additional needs to be configured.
Updating
composer update ernestdefoe/social-groups
php flarum migrate
php flarum cache:clear
License
Released under the MIT License. ยฉ Ernestdefoe
https://ernestdefoe.online/extension/ernestdefoe/social-groups