I use in my model code to get a relation
class User extends Authenticatable { // ... public function extensions() { return $this->belo
The highest voted answer didn't seem to work for me (the relations attribute seems to be a protected array now so can't be used as a collection in @DevK's answer), I instead used:
relations
$parent->setRelation('child', $parent->child->first()->setVisible(['id']));