Download the PHP package binafy/laravel-reactions without Composer

On this page you can find all versions of the php package binafy/laravel-reactions. 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-reactions

Laravel Reactions

Binafy Laravel Reactions

PHP Version Require Latest Stable Version Total Downloads License Passed Tests Ask DeepWiki

Introduction

Laravel Reactions is a simple and flexible package that enables you to add reaction functionality (such as 👍, ❤️, 😂, etc.) to any Eloquent model in your Laravel application. Whether you're building a social network, blog, or forum, this package makes it easy for users to express themselves through customizable reactions.

🔧 Features:

Installation

You can install the package with Composer:

Publish

If you want to publish a config file, you can use this command:

If you want to publish the migrations, you can use this command:

For convenience, you can use this command to publish config, migration, and ... files:

Usage

Setting Up Your Models

Before using reactions, your models need the appropriate traits. User models require the Reactor trait to create reactions, while content models require the Reactable trait to receive reactions.

User Model Setup

Content Model Setup

Creating Reactions

There are multiple ways to create reactions depending on your application's needs. You can create reactions from the user perspective or from the reactable content perspective.

From User Models

Users can react to any reactable content using the reaction() method from the Reactor trait:

From Reactable Models

Reactable content can also initiate reactions, which is useful when you want to handle reactions from the content's perspective:

Checking Reactions

You can check whether content has been reacted to by specific users using the isReacted() method:

Basic Reaction Queries

The Reactable trait provides several methods for querying reaction data:

Counting Reactions by Type

Getting All Reaction Counts

Getting Reactors

Removing Reactions

Reactions can be removed either by type or completely:

Remove Specific Reaction Type

Remove All Reactions

Events

Event Description
StoreReactionEvent When store new reaction
RemoveReactionEvent When remove a reaction
RemoveAllReactionEvent When remove all reactions

Contributors

Thanks to all the people who contributed. Contributors.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

Changelog

The changelog can be found in the CHANGELOG.md file of the GitHub repository.

License

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

Star History

Star History Chart

Donate

If this package is helpful for you, you can buy a coffee for me :) ❤️


All versions of laravel-reactions with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
laravel/framework Version ^10.0|^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 binafy/laravel-reactions contains the following files

Loading the files please wait ...