CommentPolicy you already use for Livewire.
Policy
Core ships aCommentPolicy. create() accepts a nullable user so guests can post when allow_guests is on. Guests still cannot update or delete.
If you copied the policy into your app, keep this signature:
Gate::forUser($user) using ApiAuth::user(), so the acting user is the Pro guard. Not whatever Auth::user() would be on a mis-paired api group.
Each comment in the JSON resource includes:
Comment bans
Temporarily block a user from posting:- Add a
comment_banned_untilcolumn onusers(core ships a migration you can publish). - Add the trait:
- Set
comment_banned_untilto a future date.
GET ui reports auth.banned and auth.can_comment. API writes return comment_banned. Filament Pro’s Ban author action sets a 30-day ban through the same column.
Moderators
Pins, media limits, and staff badges are Commentify Pro. The ban column and
HasCommentBan trait above are part of the free package.isCommentifyModerator()on the user model returns true, or- their id is in
commentify-pro.badges.moderator_ids
ModeratorGate::role() is guest, user, or moderator and selects media.limits.*.
Visibility of pending comments
Unapproved comments are hidden from list endpoints, except the authenticated author’s own pending rows (VisibilityScope::applyApprovedOrOwn). The SDK sets pending: true when is_approved is false so you can show “Awaiting moderation” to that author.
Read-only mode
EnsureCommentifyWritable and fail with 423 / read_only. Useful for archived posts, frozen tickets, or legal holds.
