relaticle/comments
relaticle/comments adds threaded, polymorphic comments to any Laravel Eloquent model. Lightweight and configurable, it handles user attribution, replies, and storage out of the box so you can add discussions to your app in minutes.
composer require relaticle/comments, then publish and run its migrations (php artisan vendor:publish --tag="comments-migrations" and php artisan migrate). Check the package config file after publishing — it is where the commenter model, key type, and mention behavior are wired up.Post or Ticket). Add the package's commentable trait to that model and you get a comments() relation you can render and create against.User/author model does not use auto-incrementing integers.commenter/morph columns), and the trait on your commentable model. These three drive most day-to-day behavior.$model->comments()->create([...]) for writes; keep the commenter resolved from the authenticated user in a controller/action rather than scattering it in views.HasUuids/HasUlids, upgrade to at least v1.1.1 so mention IDs persist correctly. This is the main reason to bump from v1.1.comments.commenter (and reply relations if used) on the commentable model to avoid N+1 when displaying threads. Sanitize rendered comment bodies since they contain user input, including mention tokens.Relation::enforceMorphMap(), the morph alias stored on comments must match what you registered. Changing an alias later silently orphans existing comments — decide the alias early.How can I help you explore Laravel packages today?