I want to use the following query.
SELECT `name`, COUNT(`user_id`) AS total, SUM(`status` = 'Done') as done
FROM posts GROUP BY `name`, `user_id`, `status`
But when I implemented this...
Post::selectRaw('count(user_id) as total')
->selectRaw('SUM(status = "Done") as done')
->groupBy('name')
->get();
My data table doesn't display any data. Is there something wrong in my query?