We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On a collection, it should be possible to do
$collection->column('id');
to get the same result as what array_column($array, 'id');
array_column($array, 'id');
would give you.
Currently, I have had to go by using something like this:
$uuids = $collect->map(function($category) { return $category->id; });
Unless i'm missing something, there is no column method on collections?
The text was updated successfully, but these errors were encountered:
Ah, it appears that pluck does this.
pluck
Would it make sense to have an alias for pluck as column since thats what the method is called in PHP?
column
Sorry, something went wrong.
@shopblocks pluck makes perfect sense.
You are plucking id column out of the array and creating a new one.
id
For anyone googling around $collection->pluck('name')->toArray();
$collection->pluck('name')->toArray();
No branches or pull requests
On a collection, it should be possible to do
to get the same result as what
array_column($array, 'id');
would give you.
Currently, I have had to go by using something like this:
Unless i'm missing something, there is no column method on collections?
The text was updated successfully, but these errors were encountered: