All Projects → mohamednagy → Laravel-rating

mohamednagy / Laravel-rating

Licence: MIT license
Laravel package that allows you to rate, like & dislike and vote(+1,-1) your models with a simple and clear ways

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to Laravel-rating

yii2-vote
Provides voting for any model 👍 👎
Stars: ✭ 70 (-65.69%)
Mutual labels:  rating, vote
Raty
🌟 Raty - A Star Rating Plugin
Stars: ✭ 2,292 (+1023.53%)
Mutual labels:  rating, vote
rating
⭐ A true Bayesian rating system with scope and cache enabled
Stars: ✭ 49 (-75.98%)
Mutual labels:  rating, vote
rater-js
Star rating widget for the browser. Unlimited number of stars. No dependencies. No Jquery required.
Stars: ✭ 66 (-67.65%)
Mutual labels:  rating, vote
Laravel Love
Add Social Reactions to Laravel Eloquent Models. It lets people express how they feel about the content. Fully customizable Weighted Reaction System & Reaction Type System with Like, Dislike and any other custom emotion types. Do you react?
Stars: ✭ 822 (+302.94%)
Mutual labels:  rating, vote
App review
App Review - Request and Write Reviews and Open Store Listing for Android and iOS in Flutter. Maintainer: @rodydavis
Stars: ✭ 213 (+4.41%)
Mutual labels:  rating
JHLikeButton
❤️点赞动画,点赞星星,点赞爱心,抖音点赞 ❤️
Stars: ✭ 41 (-79.9%)
Mutual labels:  like
Rating
Laravel Eloquent Rating allows you to assign ratings to any model.
Stars: ✭ 175 (-14.22%)
Mutual labels:  rating
Rateit.js
Rating plugin for jQuery. Fast, Progressive enhancement, touch support, icon-font support, highly customizable, unobtrusive JavaScript (using HTML5 data-* attributes), RTL support, supports as many stars as you'd like, and also any step size.
Stars: ✭ 146 (-28.43%)
Mutual labels:  rating
bot
Completely free and open-source human-like Instagram bot. Powered by UIAutomator2 and compatible with basically any Android device 5.0+ that can run Instagram - real or emulated.
Stars: ✭ 321 (+57.35%)
Mutual labels:  like
YouTube.js
🎥 full-featured wrapper around YouTube's private API — reverse engineering InnerTube
Stars: ✭ 2,232 (+994.12%)
Mutual labels:  like
like
Let your users like your Craft website's entries, assets and any other element.
Stars: ✭ 44 (-78.43%)
Mutual labels:  like
like-mysql
Simple and intuitive ORM for MySQL
Stars: ✭ 24 (-88.24%)
Mutual labels:  like
React Native In App Review
The Google Play In-App Review API, App store rating API lets you prompt users to submit Play Store or App store ratings and reviews without the inconvenience of leaving your app or game.
Stars: ✭ 175 (-14.22%)
Mutual labels:  rating
youtube-auto-like
Chrome extension that automatically likes videos from your subscribed channels.
Stars: ✭ 107 (-47.55%)
Mutual labels:  like
Structured Data Json Ld
Collection of structured data snippets in Google preferred JSON-LD format.
Stars: ✭ 157 (-23.04%)
Mutual labels:  rating
dotfiles
Some items in /home/kiedtl/etc
Stars: ✭ 49 (-75.98%)
Mutual labels:  like
RevealLayout
揭示效果布局,可以指定2个子布局,以圆形揭示效果切换选中状态
Stars: ✭ 118 (-42.16%)
Mutual labels:  like
bubble-hearts
(<3kb) 💖Bubble hearts animation.(Canvas 实现直播间点赞动画)
Stars: ✭ 44 (-78.43%)
Mutual labels:  like
Vulnerability Rating Taxonomy
Bugcrowd’s baseline priority ratings for common security vulnerabilities
Stars: ✭ 227 (+11.27%)
Mutual labels:  rating

               

New Maintainer

This package now maintined by Ahmed Nagi

Laravel-Ratings

Laravel package that allows you to rate, like & dislike or vote up & down your models with a simple and clear way.
If you see this packge can help, Don't skimp on me with a star :)

Rating

include CanRate trait into your user model to apply rating functions

use Nagy\LaravelRating\Traits\Rate\CanRate;

class User extends Model
{
    use CanRate;

include Rateable trait to your model that will be rateable

use Nagy\LaravelRating\Traits\Rate\Rateable;

class Post extends Model
{
    use Rateable;

now you can rate your models as the following:

$user->rate($postModel, 5);

also you can unrate your models as the following:

$user->unrate($postModel);

// alternatively
$user->rate($postModel, -1);
// or
$user->rate($postModel, false);
// or
$user->rate($postModel, null);

get the average ratings of a model

$post->ratingsAvg();

get the total count of ratings of a model

$post->ratingsCount();

get the rated models by a user

$user->rated(); // returns a collection of rated models

Voting

include CanVote trait into your user model to apply rating functionalties

use Nagy\LaravelRating\Traits\Vote\CanVote;

class User extends Model
{
    use CanVote;

include Votable trait to your model that will be votable

use Nagy\LaravelRating\Traits\Vote\Votable;

class Post extends Model
{
    use Votable;

now you can vote your model as the following:

// up vote or +1  your model
$user->upVote($postModel);

// down vote or -1 your model
$user->downVote($postModel);

get total votes count

$postModel->votesCount();

get total up votes count

$postModel->upVotesCount();

get total down votes count

$postModel->downVotesCount();

get the up voted models by a user

$user->upVoted(); // returns a collection of up voted models

get the down voted models by a user

$user->downVoted(); // returns a collection of down voted models

get the total voted models by a user

$user->voted(); // returns a collection of total voted models;

Like & Dislike

include CanLike trait into your user model to apply like and dislike functionalties

use Nagy\LaravelRating\Traits\Like\CanLike;

class User extends Model
{
    use CanLike;

include Likeable trait to your model that will be likeable

use Nagy\LaravelRating\Traits\Like\Likeable;

class Post extends Model
{
    use Likeable;

now you can like your model as the following:

// like
$user->like($postModel);

// dislike
$user->dislike($postModel);

get total likes count

$postModel->likesCount();

get total dislikes count

$postModel->dislikesCount();

get total likes and dislikes count

$postModel->likesDislikesCount();

get the liked models by a user

$user->liked(); // return a collection of liked models;

get the disliked models by a user

$user->disliked(); // return a collection of disliked models;

get the total liked and disliked models by a user

$user->likedDisliked(); // return a collection of liked and disliked models;

Install

for laravel 8.* , 7.* , 6.*

composer require nagy/laravel-rating

for laravel 5.*

composer require nagy/laravel-rating:^1.2

in your config/app.php

    'providers' => [
        ...
        Nagy\LaravelRating\LaravelRatingServiceProvider::class
    ],

    'aliases' => [
        ...
        "LaravelRating" => \Nagy\LaravelRating\LaravelRatingFacade::class,
    ]

You don't need this step in laravel5.5 package:discover will do the job :)

publish the migrations

php artisan vendor:publish --tag=laravelRatings

run the migrations

php artisan migrate
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].