NewWe open-sourced 50+ Laravel packages
Custom AI apps, agents and automation — Roundly ConsultingRoundly
All packages

Each action dispatches an event carrying the affected review, so you can notify authors, alert support on low ratings or refresh search indexes without modifying the package. All live in RoundlyConsulting\Reviews\Events:

EventDispatched whenPayload
ReviewCreatedA review is created (after its photos are attached and committed).review
ReviewApprovedA review becomes approved — by Reviews::approve(), on create, or by re-moderation after an edit.review
ReviewRejectedA review becomes rejected — by Reviews::reject(), or by the moderator on create or after an edit.review, ?string reason
ReviewUpdatedReviews::update() saves an edit.review
ReviewDeletedReviews::delete() soft-deletes a review.review
ReviewRespondedAn owner response is created.parent, response
ReviewVotedA helpful vote is cast or flipped.review, vote
ReviewVoteRemovedAn existing helpful vote is withdrawn.review, voter
ReviewVerifiedReviews::verify() or unverify() changes the verified flag.review, bool verified (the new state)
use Illuminate\Support\Facades\Event;
use RoundlyConsulting\Reviews\Events\ReviewCreated;
use RoundlyConsulting\Reviews\Events\ReviewRejected;

Event::listen(function (ReviewCreated $event): void {
    logger()->info('New review', ['id' => $event->review->id]);
});

Event::listen(function (ReviewRejected $event): void {
    // $event->review, $event->reason (?string)
});

Worth knowing

  • Events come from the actions, which the facade, an injected manager, the builder, the traits and the Review model helpers all run. A raw Eloquent change — $review->delete() on the model, say — fires no package event.
  • A review that lands approved or rejected on create (approved(), auto_approve or the moderator) or after an edit fires ReviewApproved or ReviewRejected too, after ReviewCreated or ReviewUpdated.
  • The package listens to ReviewApproved itself to warm photo variants on the queue when photos are enabled — however the review became approved.

Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

More ways to support, including crypto

By donating, you agree to our donation terms.

Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.