Download the PHP package shubhang/laravel-dislikeable without Composer
On this page you can find all versions of the php package shubhang/laravel-dislikeable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download shubhang/laravel-dislikeable
More information about shubhang/laravel-dislikeable
Files in shubhang/laravel-dislikeable
Download shubhang/laravel-dislikeable
More information about shubhang/laravel-dislikeable
Files in shubhang/laravel-dislikeable
Vendor shubhang
Package laravel-dislikeable
Short Description Trait for Laravel Eloquent models to allow easy implementation of a 'dislike' feature.
License MIT
Package laravel-dislikeable
Short Description Trait for Laravel Eloquent models to allow easy implementation of a 'dislike' feature.
License MIT
Please rate this library. Is it a good library?
Informations about the package laravel-dislikeable
Laravel DisLikeable Plugin
Trait for Laravel Eloquent models to allow easy implementation of a "Dislike" feature.
Composer Install (for Laravel 5)
composer require shubhang-arora/laravel-dislikeable "~1.0"
Install and then run the migrations
Setup your models
class Article extends \Illuminate\Database\Eloquent\Model {
use Shubhang\DisLikeable\DisLikeableTrait;
}
Sample Usage
$article->dislike(); // dislike the article for current user
$article->dislike($myUserId); // pass in your own user id
$article->dislike(0); // just add dislikes to the count, and don't track by user
$article->undislike(); // remove dislike from the article
$article->undislike($myUserId); // pass in your own user id
$article->undislike(0); // remove dislikes from the count -- does not check for user
$article->dislikeCount; // get count of dislikes
$article->dislikes; // Iterable Illuminate\Database\Eloquent\Collection of existing dislikes
$article->disliked(); // check if currently logged in user disliked the article
$article->disliked($myUserId);
Article::whereDisLiked($myUserId) // find only articles where user disliked them
->with('dislikeCounter') // highly suggested to allow eager load
->get();
Credits
- Shubhang Arora
All versions of laravel-dislikeable with dependencies
PHP Build Version
Package Version
The package shubhang/laravel-dislikeable contains the following files
Loading the files please wait ....