Allow upvoting without associating with model
Darthmaul opened this issue · comments
Andrew Nolan commented
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.
Mohamed Nagy commented
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
Ahmed Nagi commented
Closed, due to inactivity.