Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

KikoLdasd's avatar

How can I calculate certain variables directly from the query?

Hi, I would like to calculate two variables in this query, namely dismissed and clicked if they are true, how can I do that? May?

$query = Popup::query()
                        ->where('client_id', $clientId)
                        ->whereBetween('created_at', [$startDate->format('Y-m-d')." 00:00:00", $endDate->format('Y-m-d')." 23:59:59"]);
0 likes
1 reply

Please or to participate in this conversation.