mohamednagy / Laravel-rating

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow upvoting without associating with model

Darthmaul opened this issue · comments

Hello,

I am wondering if there is a way currently to "upvote/downvote" a particular resource without a model attached to the "voting".

E.g.:
Instead of: $user->upVote($item); allow upvote($item);

If not, it seems like this could be added, I'm just not sure if the architecture allows it.

Thanks.

vote on item you have to tell who is voting, $item should be linked to a user. we can introduce helpers to be as:

public function upvote(Model $item)
{
       auth()->user()-> upVote($item);
}

and then can be used as: upvote($item);

Unfortunately i don't have time to implement it right now, any PR to add it will be welcomed

Closed, due to inactivity.