6 Tricks for Laravel Collections

Tutorials

May 28th, 2015

Jeff Madsen has a new post covering six tricks for working with Laravel collections.

His tricks cover the follow methods:

  • find()
  • where()
  • where() & lists()
  • implode()
  • groupBy()
  • as a union

Using find with an array is one I never remember:

1$collection = AppPerson::find([1, 2, 3]);

Give the post a read and I’m sure you’ll pick up a few tips and tricks.

Filed in:

Eric L. Barnes

Eric is the creator of Laravel News and has been covering Laravel since 2012.