I have a statement like this:
App\\User::with(\'client\')->find(2)->makeHidden(\'client.phone_no\');
I want to hide certain columns f
With accepts a callback to modify the query.
$users = User::with(['client' => function($query) { $query->select(['id', 'name']); }])->find(2);
You could also define default hidden attributes on your Client model
protected $hidden = ['phone_no'];