Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel User Guest Like

Laravel User Guest Like Laravel Package

kilobyteno/laravel-user-guest-like

A Laravel package that lets both authenticated users and guests like your Eloquent models. Add the trait, and get simple methods for liking, unliking, and checking likes, with guest likes tracked automatically and no extra setup required.

View on GitHub
Deep Wiki
Context7

A Laravel package to allow guests and users to like models

Frequently asked questions about Laravel User Guest Like
How do I install kilobyteno/laravel-user-guest-like in a Laravel application?
Install the package with Composer using composer require kilobyteno/laravel-user-guest-like. Publish and run the package migrations so the likes table is created, then add the provided trait to any Eloquent model that should be likeable. In most Laravel apps the setup takes only a few minutes with no extra service configuration.
Which Laravel versions does laravel-user-guest-like support?
Version 1.5.0 adds support for Laravel 13 and drops Laravel 11, so it targets Laravel 12 and 13 applications. If your application is still on Laravel 11, pin the package to 1.4.x until you complete the framework upgrade. Always check the package composer constraints and PHP requirement before upgrading in production.
How do guests like a model without logging in?
The package tracks guest likes automatically, so anonymous visitors can use the same like and unlike methods as authenticated users. Guest identity is resolved and persisted by the package, typically through the session or a cookie-based identifier, with no additional setup required. You should still document how that identity behaves for your application and privacy requirements.
How do I make an Eloquent model likeable?
Add the package trait to the model that should receive likes, such as a Post or Comment model. After running the migrations, the model exposes simple methods for liking, unliking, and checking like status. You can apply the trait to multiple models because the package uses polymorphic relationships.
How can I check whether a user or guest has already liked a model?
Use the package helper methods on the likeable model to check the current actor's like status, such as hasLiked or an equivalent method. The same check works for authenticated users and guests because the package resolves the current actor automatically. This makes it straightforward to render the correct button state in Blade or an API response.
Does the package prevent duplicate likes from the same user or guest?
Duplicate prevention should be enforced at the database level with a unique constraint covering the likeable model, user ID, and guest identifier. The package provides the like and unlike methods, but you should verify the published migration and add indexes that match your access patterns. At scale, deliberate indexing and concurrency handling are important because like tables grow quickly.
What happens to guest likes if a visitor clears cookies or changes browsers?
Guest likes depend on the anonymous identifier the package stores, so clearing cookies or switching devices can make the visitor appear new and allow another like. This is an inherent limitation of anonymous engagement tracking rather than authenticated identity. Document this behavior and consider product rules for how long guest like records should be retained.
Is there built-in rate limiting or bot protection for guest likes?
The package focuses on the like relationship itself and does not replace application-level abuse protection. Add Laravel rate limiting, middleware, or bot detection around the routes that accept guest likes. Because anonymous traffic is easier to abuse than authenticated traffic, plan throttling and monitoring before exposing the feature publicly.
How do I upgrade from version 1.4.x to 1.5.0 safely?
Confirm that your application runs Laravel 12 or 13, then update the package with Composer and run any new migrations. Test authenticated and guest like flows in staging, including duplicate prevention and model deletion behavior, before deploying to production. Keep the previous composer lockfile and a database backup available for rollback.
What are alternatives to this package for likes and reactions in Laravel?
You can build a custom polymorphic likes table with your own trait if you need tight control over guest identity, moderation, or analytics. Other community packages may offer broader reaction systems, but they often add more configuration and dependencies. This package is best for lightweight like, unlike, and hasLiked behavior on Eloquent models without a full social graph.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo