How to sum Values of duplicate ID's

Posted 5 days ago by m4martie

I have the same user_id's with different and I want to compute the total points of that particular user. And this is what I did but I'm getting errors and/or just "0"


$points = ActivityPoint::where('points', '$reports->points')->sum('points');

And how I call to .blade

{{ $points }}

Need help for this, thank you in advance.

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.