Download the PHP package cslant/laravel-like without Composer

On this page you can find all versions of the php package cslant/laravel-like. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-like

laravel-like

The interaction for User 👍 like, 👎 dislike, and love ❤️ features for Laravel Application.

Laravel Like Package

Latest Version Total Downloads Test Status Code Style Status Quality Score

📝 Introduction

This package provides an interaction way to add like 👍, dislike 👎, and love ❤️ features to your Laravel application.

It is easy to use and can be customized to fit your needs.

📋 Requirements

📖 Official Documentation

The detailed documentation is in the Laravel Like Package - Official documentation.

🔧 Installation

You can install the package via Composer:

Configuration and Migrations

You can publish all the necessary configuration and migration files by running the following command:

After the configuration file has been published, you can run the migration:

🛠️ Usage

Facade

Like and Love both proxy the same LikeManager singleton, kept as separate facades so each stays focused on its own domain (like/dislike vs. love):

By default the acting user is resolved via auth()->id(). Pass an explicit user id as the second argument to override:

Model traits

Add HasLike to an interactable model:

Then:

Use HasLove (and/or UserHasInteraction on the user model) for love-only surfaces.

⚡ Performance

All counts are a single COUNT query, and predicates use EXISTS, so a single call never causes an N+1. But calling likesCount() or isLiked() in a loop over a list still does — use the batch APIs instead:

Or, when you're already building the query, prefer Eloquent's own withCount():

Querying a user's liked models performs one query per distinct model type (a bounded cost inherent to polymorphic relations):

When listing interactions, eager-load related models to avoid per-row queries:

Read-heavy counts can also be cached — set cache.enabled to true in config/like.php and the package invalidates it automatically on every write. See the Performance docs for the full picture.

🤖 AI agent skill

This repo ships a Claude Code skill summarizing safe usage patterns (the batch APIs, the N+1 pitfalls, the facade split). If your project uses this package and you use Claude Code, copy .claude/skills/laravel-like/ from this repo into your own project's .claude/skills/ directory so your AI assistant applies it automatically.

📄 License

The MIT License (MIT). Please see License File for more information.

🙏 Acknowledgement

This package is inspired by the laravel-like package by overtrue. I have added some additional features and improvements to the package.


All versions of laravel-like with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2|^8.4
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cslant/laravel-like contains the following files

Loading the files please wait ...