You can use pluck
method,
$groups = Post::inCategory(1)->with('user','user.group')->get()->pluck('user.group')->all()
Программирование Highload PHP, Laravel, Backend, MySQL, Docker
You can use pluck
method,
$groups = Post::inCategory(1)->with('user','user.group')->get()->pluck('user.group')->all()