finds.dev← search

// the find

hootlex/laravel-moderation

★ 529 · PHP · MIT · updated Mar 2022

A simple Content Moderation System for Laravel 5.* that allows you to Approve or Reject resources like posts, comments, users, etc.

A Laravel trait that adds approve/reject/postpone status to any Eloquent model via a global query scope. Drops three columns on your table and filters results automatically — pending and rejected content is invisible by default. Aimed at any Laravel app that needs human review before content goes live.

Global scope integration is clean: once you add the trait, `Post::all()` just works without callers needing to remember a filter. Four-state status model (pending/approved/rejected/postponed) covers the real-world case where 'not ready yet' and 'actively rejected' are different things. Per-model column name overrides mean it won't collide with existing schemas. Tests actually exercise the query scopes against a real SQLite database, not just mocks.

Last touched in 2022 and pinned to Laravel 5.* — it works on modern Laravel but you're running unmaintained code in a security-relevant path. No built-in audit trail beyond `moderated_by` and `moderated_at`: there's no history of status changes, so if a moderator flips something twice you lose the first action. Strict mode is a global config flag rather than per-request context, which makes it awkward to build an admin preview where moderators see pending content alongside approved. No events or hooks fired on status transitions — you'll have to wrap every `markApproved()` call yourself if you want to notify users or log changes.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →