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

All package exceptions live in RoundlyConsulting\Likes\Exceptions:

ExceptionThrown when
InvalidReactionTypeExceptionA reaction type is not in likes.reactions — including a default_reaction missing from the list.
NoAuthenticatedActorExceptionThe facade, a PendingLike chain or @liked needs an actor, none was passed and actor_resolver resolves nothing.
LikesExceptionNever directly — the abstract base of both, extending RuntimeException. Catch it to handle any package error.

Catch the base class to turn any package error into a response:

use RoundlyConsulting\Likes\Exceptions\LikesException;
use RoundlyConsulting\Likes\Facades\Likes;

try {
    Likes::as($request->string('reaction')->toString())->react($post);
} catch (LikesException $e) {
    abort(422, $e->getMessage());
}

The InteractsWithLikes testing helpers throw a plain RuntimeException when no liker is set — see Testing.

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.