Reputation: 4175
I have a model called User which contains emails and names. I want to extract all the email from this model to an array. Does anyone has any idea how can I do this in simplest form possible ?
Upvotes: 0
Views: 243
Reputation: 36
User::get(['email'])->toArray()
Also remember that array shorttags are for PHP 5.4+
Upvotes: 2