How to calculate the total likes of all posts of a user
i need to count users all posts like
$post = Post::whereUserId(auth::id())->get('id');
$postlikes = PostLike::wherePostId($post)->count('post_id);
it's work in foreach. but I am looking for some more convenient way
Please sign in or create an account to participate in this conversation.
There's no shortage of content at Laracasts. In fact, you could watch nonstop
for days upon days, and still not see everything!