Let's say, we have hidden attribute in our Model settings but we want to show it in specific query results only. How to do that?
OK, our hidden attribute is 'created_at'
protected $hidden = ['created_at']
And now we are getting our model and ofcourse this field was not returned:
$user = User::where('slug','=',$slug)->first();
And if we want to make visible created_at just for this results, we can do something like this:
$user = User::where('slug','=',$slug)->first();
$user->makeVisible(['created_at']);