morning,
i have little problem about select for parend and related obiect, below u can see little cutted fragment of code
$workplaces = Workplace::select('id');
$workplaces = $workplaces->with(['users' => function($query) {
return $query->select('id', 'name'');
}]);
$workplaces = $workplaces->get();
the problem is when i set select for workplace, user is always empty, i tried also add to select something like users.id, but then i got errors, its possible to do something like this using with? i dont want joins here (in code, its about functions, i know joins are hidden here) because it has to be dynamic and with is more clear in code