filagora / filagora-forums
Forums for Filagora: forum groups, forums, threads and posts, visibility and posting rules, and moderation, as a Filament plugin.
Requires
- php: ^8.4
- filagora/filagora-core: ^0.2
- filagora/filagora-entitlements: ^0.2
- filament/filament: ^5.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.0
- orchestra/testbench: ^11.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-10-13 21:42:03 UTC
README
Forum groups, forums, threads and posts for Filagora, with visibility and posting rules,
moderation, reports and a staff queue, as a Laravel 13 / Filament 5 plugin. Requires
filagora/filagora-core and
filagora/filagora-entitlements.
The package is at
0.1: the API may change between0.xminor versions. There is no frontend: it is models, services, events and staff screens, and you build the public pages.
What it does
-
The seven tables (
forum_groups,forums,threads,posts,post_reports,post_moderation_logs,thread_moderation_logs), matching the shape of the forum they were extracted from index for index, including the generatedthreads.last_activity_atcolumn, the FULLTEXT indexes on forum names, thread titles and post bodies, and the tuned listing indexes. They are built for forums with hundreds of thousands of threads. -
Models and enums (
Forum,ForumGroup,Thread,Post,PostReport,PostModerationLog,ThreadModerationLog; forum visibility, posting policy, moderation status, report status). Every stored value is kept, so existing data loads. Model classes can be swapped underfilagora.models.<key>. -
A schema snapshot so
filagora:adopt(from core) can start the package on a database that already holds these tables. A site's own extra columns are declared with a coreSchemaExtension. -
The access rules (
ForumAccess): who can view a forum, open a thread, post and reply, from the forum's visibility (public, registered, staff only, entitlement only, paid only, paid or author, staff or author) and posting policy, the viewer's entitlements, and whether they have authored in the forum. It also says which forums a viewer sees in full, which only their own threads in, and gives query scopes for visible threads and posts. -
Three staff abilities (
filagora.forums.moderate,.view_unapproved,.bypass_approval), each mapped to an entitlement key infilagora-forums.gates; holding any one makes a user staff. Remap them to your own keys in config. -
Two extension points: bind
PaidAccessCheckto say what "paid" means for forums that name no entitlement (the default grants nobody), andStaffPreviewif your frontend can switch staff privileges off to see the forum as a member does (the default is always on). -
Counters kept right. A forum holds
thread_count,post_countand last-post fields, and a thread holdsreply_countand last-post fields, so listings never count rows. They are updated incrementally as threads and posts change (a post counts when it and its thread are approved), andfilagora:forums:sync-statsandfilagora:forums:sync-thread-statsrebuild them from the data if they ever drift. AForumStatsChangedevent tells a frontend when to drop its caches. -
Posting.
Postingstarts threads, replies and edits posts, checkingForumAccessfirst and refusing withPostingNotPermittedand a reason (PostingDenial). A new thread creates its first post with it. Whether content waits for a moderator follows the forum's approval flags, the author'sfilagora.forums.bypass_approvalentitlement and yourContentModerationPolicy; slugs are made unique; an identical post within 15 seconds is returned rather than duplicated; counters are kept right. Authors may edit their own posts within a window set by theforum_post_edit_window_minutessetting (default 30), and an edit shows as "edited" afterforum_post_edit_grace_period_minutes(default 5). EventsThreadCreated,PostCreatedandPostEditedlet add-ons (subscriptions, mentions, notifications, attachments) hook in. -
Two more extension points:
ContentModerationPolicy(users whose content is always moderated, and a first post awaiting review) andPostSignatureResolver(the signature copied onto new posts). Both do nothing by default. -
Moderation. For moderators (
filagora.forums.moderate; anyone else getsModerationNotPermitted):ThreadModerationlocks, unlocks, pins, unpins, moves, renames, approves and permanently deletes threads;PostModerationsoft-deletes (singly or up to 200 at once), restores, approves, unapproves and rejects posts;PostRelocationmoves posts to another thread and promotes posts into a new one, singly or in batches, and removes a thread the move emptied. Each action writes a row to the thread or post moderation log, re-derives the counters, and dispatchesThreadModerated,PostModeratedorThreadDeleted, which is where you notify authors or ban them. Undo is left to the frontend. -
Reports.
PostReports::report()lets a member who can see an approved post report it once;resolve()closes every open report on the post at once asdismiss,keep,removeorremove_thread(the whole thread, if the post is all it holds) and dispatchesPostReportsResolvedwith the reporters' ids. -
Filament screens.
FilagoraForumsPluginadds forum groups and forums (create and edit), threads, posts and post reports (browse, filter, and act through the moderation services, so every action is logged and counted), a Moderation queue page (threads and replies waiting for approval, reported replies one row each) and aModerationQueueStatsdashboard widget. Every screen needs thefilagora.forums.moderateability. Register it on the panel next to the core and entitlements plugins:->plugins([ FilagoraCorePlugin::make(), FilagoraEntitlementsPlugin::make(), FilagoraForumsPlugin::make(), ])
The moderation queue's navigation badge and the widget count what is waiting; add
ModerationQueueStats::classto your dashboard if your panel lists widgets explicitly.
Install
composer require filagora/filagora-forums
php artisan migrate
php artisan filagora:entitlements:sync # creates the forum entitlement definitions
Register the plugin on your Filament panel, after the core and entitlements plugins:
->plugin(\Filagora\Forums\FilagoraForumsPlugin::make())
To start from a database that already holds these tables, run php artisan filagora:adopt
instead of migrate (see filagora/filagora-core).
Testing
composer test
Tests run against a real MariaDB database named testing.
Licence
MIT. See LICENSE.