Making visible or hidden attributes from Eloquent temporarily
snippet in php

Making visible or hidden attributes from Eloquent temporarily

user5642

$users = $users->makeVisible(['address', 'phone_number']);
$users = $users->makeHidden(['address', 'phone_number']);