Aug 11, 2021
0
Level 3
Custom withSum query
Hello,
Can a query like the one below be written using withSum method or in a more eloquent way?
DB::raw('(select sum(JSON_LENGTH(`stores`.`baskets`)) from `stores` where `users`.`id` = `stores`.`user_id`) as `baskets_count`')
Please or to participate in this conversation.