If I build a collection from an array:
$collection = collect(['name' => 'john', 'age' => '20']);
How can I access it like you access models, e.g.
$collection->name; //john
I'm having to use $collection['name']
.
Is there a way to access it with arrows?