Laravel Collection helper for digging through deep properties #45345
Unanswered
ZebTheWizard
asked this question in
Ideas
Replies: 1 comment
-
Pluck supports nested values. https://laravel.com/docs/9.x/collections#method-pluck |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Wish there was a more elegant way to pluck deep properties when working with large datasets.
Recently, we needed to calculate the average dpi for a collection of images corresponding to a product.
Normally we try to write something like this because it's easier to read than loops
Wish we could simplify the above to something like this:
Always copying and pasting this snippet between projects so I quickly write out common calculations
Beta Was this translation helpful? Give feedback.
All reactions