Are you ure you want to group by
user_id? What are you trying to do?
@kokokurak This is sample like sudo code.
But I think group by is not a problem.
if I use
$article = new Article(); $query = $article->with('user') ->where('user_id', '=', 1) $user = $query->get(['name','post','user.name']);
select name, post from `articles` where `user_id` = ? select name from `users` where `user`.`id` in (?)
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'user.name' in 'field list' (SQL: select `name`, `post`, `user`.`name` from `articles` where `user_id` = 1)
Sign in to participate in this thread!
We'd like to thank these amazing companies for supporting us