Basically, I want to do this:
$locals['companies'] = Company::orderBy('name')->get(['id','name'])->map(function($c) { return [$c->id, $c->name]; })->toArray();
But without such a verbose map
function. Isn't there a get-like method that will return flat numeric arrays instead of objects?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire