Download the PHP package hkp22/laravel-reactions without Composer

On this page you can find all versions of the php package hkp22/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?
hkp22/laravel-reactions
Rate from 1 - 5
Rated 4.00 based on 1 reviews

Informations about the package laravel-reactions

Add Reactions (like, dislike, etc.) to Eloquent Model

Latest Version on Packagist GitHub Tests Action Status Styling Psalm Total Downloads

Laravel reactions package for implementing reactions (eg: like, dislike, love, emotion etc) on Eloquent models.

Video Tutorial

▶️ Laravel Reactions Tutorial

Installation

Download package into the project using Composer.

Registering package

Laravel 5.5 (or higher) uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

For Laravel 5.4 or earlier releases version include the service provider within app/config/app.php:

Database Migration

If you want to make changes in migrations, publish them to your application first.

Run database migrations.

Config File

You can optionally publish the config file with:

Usage

Prepare Reacts (User) Model

Use Qirolab\Laravel\Reactions\Contracts\ReactsInterface contract in model which will perform react behavior on reactable model and implement it and use Qirolab\Laravel\Reactions\Traits\Reacts trait.

Prepare Reactable Model

Use Qirolab\Laravel\Reactions\Contracts\ReactableInterface contract in model which will get reaction behavior and implement it and use Qirolab\Laravel\Reactions\Traits\Reactable trait.

Available Methods

Reaction

Remove Reaction

Removing reaction of user from reactable model.

Toggle Reaction

The toggle reaction method will add a reaction to the model if the user has not reacted. If a user has already reacted, then it will replace the previous reaction with a new reaction. For example, if the user has reacted 'like' on the model. Now on toggles reaction to 'dislike' then it will remove the 'like' and stores the 'dislike' reaction.

If a user has reacted like then on toggle reaction with like. It will remove the reaction.

Boolean check if user reacted on model

Reaction summary on model

Get collection of users who reacted on model

Scopes

Find all articles reacted by user.

Reaction on Model

Events

On each reaction added \Qirolab\Laravel\Reactions\Events\OnReaction event is fired.

On each reaction removed \Qirolab\Laravel\Reactions\Events\OnDeleteReaction event is fired.

Testing

Run the tests with:

Spec Coder


All versions of laravel-reactions with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
illuminate/database Version ~5.5|~5.6|~5.7|~5.8|^6.0|^7.0|^8.0
illuminate/support Version ~5.5|~5.6|~5.7|~5.8|^6.0|^7.0|^8.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 hkp22/laravel-reactions contains the following files

Loading the files please wait ....