We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Example: Get the number of rows along with the total value of the percent field
$result = UserActivity::select(function($s){ $s->sum('percent')->as('sum'); $s->count()->as('count'); })->where('client_id', $client->id)->first();
Output:
{"sum": 160, "count": 3}
There was an error while loading. Please reload this page.