I have a statement like this:
App\\User::with(\'client\')->find(2)->makeHidden(\'client.phone_no\');
I want to hide certain columns f
If you don't want to hide the phone_no for all the requests by adding it to the hidden property, you could do something like this:
$user = App\User::with('client')->find(2);
$user->client->makeHidden('phone_no');
return $user;
As I stated in my comment to the original question: I found this method as well. I believe this should be the method you should use when you want to exclude columns more often. If you only want to exclude a column once, my solution should be sufficient.