I want to add a field to the result set of an eloquent query that its value is provided by a subquery.
In other words I want the returned eloquent models have an extra field using that subquery.
SELECT * , ( SELECT COUNT( * ) FROM `items` AS `i` INNER JOIN `places` ON `places`.`item_id` = `i`.`id` INNER JOIN `participants` ON `participants`.`place_id` = `places`.`id` WHERE `items`.`id` = `i`.`id` AND `participants`.`approved` =1 ) AS `unapproved_participants` FROM `items`
so I have both
items fields and the