jreviews:permission:comment.see_vote_widget
Filters whether the voting widget should be displayed for a comment.
You need to have a working knowledge of Hooks before you get started.
Fires when determining if vote widget should be rendered
Parameters
| Name | Type | Description |
|---|---|---|
$canSeeVoteWidget |
bool |
Whether the vote widget should be shown |
$user |
\JReviews\App\Models\User |
The current user |
$comment |
\JReviews\App\Models\Comment |
The comment |
Boilerplate Code
Use the boilerplate code to start using the filter, and add your own logic to modify the first argument and return it.
fwd_add_filter('jreviews:permission:comment.see_vote_widget', function($canSeeVoteWidget, $user, $comment)
{
// Your code here
return $canSeeVoteWidget;
});
Source Files
app/Policies/CommentPolicy.php