I have something like this in my controller:
$item = item::where('id',1)->first();
I get a Collective object.
I want to retrieve a specific table from such item.
$item->only(['name]);
So I can give it to the view. However it won't work.
BadMethodCallException in Builder.php line 2508: Call to undefined method Illuminate\Database\Query\Builder::only()
How do I retrieve this concrete variable?