Browsing as a guest. You can post with a name and email, like, and report. Sign in as Maya, Tomas, Priya… to pin, moderate, and see author badges from the other side.

One thread · three frontends

The same comments. Three stacks.

Polymorphic relations are underrated is a single Eloquent record. Livewire, React, and Vue all render the same thread UI. This public demo mounts <livewire:comments /> for every tab. React and Vue components ship with Commentify and match this markup.

Discussion (5)

Or Log in to comment!

Jonas Weber Jonas Weber

The point about losing foreign keys is the one that always comes up in review, and I think it gets overweighted. In five years I have never had an orphaned comment row cause a production incident. I have had three separate *_comments tables drift out of sync on features.

Aisha Bello Aisha Bello

Moderator note: the comment that used to sit here with two scam URLs was denied by the heuristic checker. That is the spam pipeline, not a person at 2am.

Sam Okafor Sam Okafor

Shipped this pattern on my side project last month. The bit I underestimated was moderation — one table means one queue, which turned out to be the actual win.

Lukas Novak Lukas Novak

Reading this as someone six weeks into Laravel — is there a downside to just using this pattern for everything user-generated? Attachments, ratings, reactions?

Noor Haddad Noor Haddad

One thing I would add to the "where it bites" section: sorting.

most_replied needs a withCount, and if you are also filtering by approval status the counts have to respect that filter or your numbers lie. Took me an embarrassingly long afternoon to work that out.