Laravel Collections
Laravel Collections https://unsplash.com/photos/rgLl9qA6kUA?utm_source=unsplash&utm_medium=referral&utm_content=creditShareLink

Laravel Collections | Introduction

Laravel Collections are your ultimate weapon for wrangling and manipulating data in the most elegant and efficient way possible. These versatile collections are your personal data wizards, allowing you to perform a variety of operations conveniently. Whether you're dealing with database results, API responses, or simple arrays, Laravel Collections provide a consistent and expressive interface that simplifies your code and elevates your data-handling game. 

In this series of articles, we'll explore the power and versatility of Laravel Collections. I have divided this series into the following articles, from time to time, I will update the series accordingly:

Part 1:

  1. all
  2. average
  3. avg
  4. chunk
  5. chunkWhile
  6. collapse
  7. collect
  8. combine
  9. concat
  10. contains
  11. containsOneItem
  12. containsStrict
  13. count
  14. countBy
  15. crossJoin

Part 2:

  1. dd
  2. diff
  3. diffAssoc
  4. diffAssocUsing
  5. diffKeys
  6. doesntContain
  7. dot
  8. dump
  9. duplicates
  10. duplicatesStrict
  11. each
  12. eachSpread
  13. ensure
  14. every
  15. except

Part 3:

  1. filter
  2. first
  3. firstOrFail
  4. firstWhere
  5. flatMap
  6. flatten
  7. flip
  8. forget
  9. forPage
  10. get
  11. groupBy
  12. has
  13. hasAny
  14. implode
  15. intersect

Part 4:

  1. intersectAssoc
  2. intersectByKeys
  3. isEmpty
  4. isNotEmpty
  5. join
  6. keyBy
  7. keys
  8. last
  9. lazy
  10. macro
  11. make
  12. map
  13. mapInto
  14. mapSpread
  15. mapToGroups

Part 5:

  1. mapWithKeys
  2. max
  3. median
  4. merge
  5. mergeRecursive
  6. min
  7. mode
  8. nth
  9. only
  10. pad
  11. partition
  12. percentage
  13. pipe
  14. pipeInto
  15. pipeThrough

Part 6:

  1. pluck
  2. pop
  3. prepend
  4. pull
  5. push
  6. put
  7. random
  8. range
  9. reduce
  10. reduceSpread
  11. reject
  12. replace
  13. replaceRecursive
  14. reverse
  15. search

Part 7:

  1. shift
  2. shuffle
  3. skip
  4. skipUntil
  5. skipWhile
  6. slice
  7. sliding
  8. sole
  9. some
  10. sort
  11. sortBy
  12. sortByDesc
  13. sortDesc
  14. sortKeys
  15. sortKeysDesc

Part 8:

  1. sortKeysUsing
  2. splice
  3. split
  4. splitIn
  5. sum
  6. take
  7. takeUntil
  8. takeWhile
  9. tap
  10. times
  11. toArray
  12. toJson
  13. transform
  14. undot
  15. union

Part 9:

  1. unique
  2. uniqueStrict
  3. unless
  4. unlessEmpty
  5. unlessNotEmpty
  6. unwrap
  7. value
  8. values
  9. when
  10. whenEmpty
  11. whenNotEmpty
  12. where
  13. whereStrict
  14. whereBetween
  15. whereIn

Part 10:

  1. whereInStrict
  2. whereInstanceOf
  3. whereNotBetween
  4. whereNotIn
  5. whereNotInStrict
  6. whereNotNull
  7. whereNull
  8. wrap
  9. zip