laravel-enso / commentsmanager
Comments Manager for Laravel Enso
Requires
- laravel-enso/core: ^12.0
- laravel-enso/dynamic-methods: ^4.0
- laravel-enso/helpers: ^4.0
- laravel-enso/migrator: ^2.1
- laravel-enso/track-who: ^3.0
- laravel-enso/users: ^2.0
- dev-master
- 4.6.4
- 4.6.3
- 4.6.2
- 4.6.1
- 4.6.0
- 4.5.0
- 4.4.1
- 4.4.0
- 4.3.0
- 4.2.4
- 4.2.3
- 4.2.2
- 4.2.1
- 4.2.0
- 4.1.8
- 4.1.7
- 4.1.6
- 4.1.5
- 4.1.4
- 4.1.3
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.2
- 4.0.1
- 4.0.0
- 3.3.8
- 3.3.7
- 3.3.6
- 3.3.5
- 3.3.4
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.7
- 3.2.6
- 3.2.5
- 3.2.4
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.8
- 3.1.7
- 3.1.6
- 3.1.5
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.10
- 3.0.9
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.4.23
- 2.4.22
- 2.4.21
- 2.4.20
- 2.4.19
- 2.4.18
- 2.4.17
- 2.4.16
- 2.4.15
- 2.4.14
- 2.4.13
- 2.4.12
- 2.4.11
- 2.4.10
- 2.4.9
- 2.4.8
- 2.4.7
- 2.4.6
- 2.4.5
- 2.4.4
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.26
- 2.3.25
- 2.3.24
- 2.3.23
- 2.3.22
- 2.3.21
- 2.3.20
- 2.3.19
- 2.3.18
- 2.3.17
- 2.3.16
- 2.3.15
- 2.3.14
- 2.3.13
- 2.3.12
- 2.3.11
- 2.3.10
- 2.3.9
- 2.3.8
- 2.3.7
- 2.3.6
- 2.3.5
- 2.3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feature/ensoV8
- dev-upgrade/enso6-dr
- dev-upgrade/enso6
- dev-hotfix/notificationSubjects
- dev-feature/addsRelationship
- dev-upgrade/laravel8
- dev-fixes/stylci
This package is auto-updated.
Last update: 2026-04-21 15:24:26 UTC
README
Description
Comments adds polymorphic comments and tagged-user notifications to Enso models.
The package exposes a reusable Commentable trait, ships the comments CRUD API used by the backoffice, tracks authorship through Enso audit traits, and supports tagged users through a pivot relation and queued notifications.
Delete behavior is configurable, allowing applications to either cascade comment deletion or block deletion when related comments exist.
Installation
Install the package:
composer require laravel-enso/comments
Run the package migrations:
php artisan migrate
Optional publishes:
php artisan vendor:publish --tag=comments-config php artisan vendor:publish --tag=comments-mail php artisan vendor:publish --tag=comments-factory
Default configuration:
return [ 'editableTimeLimit' => 24 * 60 * 60, 'onDelete' => 'cascade', 'humanReadableDates' => true, 'loggableMorph' => [ 'commentable' => [], ], ];
Features
- Polymorphic one-to-one and one-to-many comments through the
Commentabletrait. - Tagged users stored on a pivot table and notified through queued notifications.
- Comments API with list, create, update, destroy, and user option endpoints.
- Configurable delete strategy via
restrictorcascade. - Automatic parent touching for updated commentable records.
Usage
Add the trait to any model that should expose comments:
use Illuminate\Database\Eloquent\Model; use LaravelEnso\Comments\Traits\Commentable; class Post extends Model { use Commentable; }
Available relationships:
comment()comments()
When a model is deleted, the package will either reject the deletion or cascade comment deletion based on enso.comments.onDelete.
Tagged users can be synchronized and notified through the Comment model:
$comment->syncTags($taggedUsers)->notify('/posts/1');
API
HTTP routes
GET api/core/commentsPOST api/core/commentsPATCH api/core/comments/{comment}DELETE api/core/comments/{comment}GET api/core/comments/users
Route names:
core.comments.indexcore.comments.storecore.comments.updatecore.comments.destroycore.comments.users
Model surface
LaravelEnso\\Comments\\Models\\Comment
Useful methods:
scopeFor(array $params): BuildersyncTags(array $taggedUsers)notify(string $path)
Depends On
Required Enso packages:
laravel-enso/core↗laravel-enso/dynamic-methods↗laravel-enso/helpers↗laravel-enso/migrator↗laravel-enso/track-who↗laravel-enso/users↗
Companion frontend package:
Contributions
are welcome. Pull requests are great, but issues are good too.
Thank you to all the people who already contributed to Enso!