When you need to sort a multi dimensional collection or array, let sortBy() assist. In this episode, we tackle it from basic to a custom implementation with string manipulation.
For single dimension collections there's no easier way to put it in a specific order. Learn all about custom sorting, in this episode of the Laravel Collections Guide.
Let's talk about the zip() method today, this method allows you to take 2 collections and zip them together. We'll also be looking at a trick for offsetting values.
When it comes to a long chain of method calls and transformations, sometimes, you may need to preview each step. In today's lesson, we talk about the dd() method and it does, just that.