Laravel Collections – collapse() Method
Laravel Collection provides a fluent, convenient wrapper for working with arrays. In this post, we will learn about collapse() method. The collapse() method can be used to convert a multi-dimensional collection into a single dimension...
Laravel Collections – times() Method
In this post, we will look at how we can use the times() method to quickly create numbers of Laravel Collections. The times() method of Laravel Collection is similar to PHP's range() function with some extra functionality for...
12 Laravel Collection Methods You Should Be Using Everyday
We all know that Laravel is an awesome framework for web application development. One of the most awesome parts of this framework is Laravel Collection. As Laravel Eloquent returns a collection when we grab a record from the database,...
Laravel Collections – map() Method
In this post, we will look at how we can use map() method to perform some action on each element of Laravel Collections. The map method applies a given callback function to each element of a collection. The callback function will modify...
Laravel Collections – wrap and unwrap methods
In this post, we will look at how wrap() and unwrap() methods can be used when dealing with Laravel Collections. This is a third part of Laravel Collections Series. wrap() Method As I discussed in previous post that the make() method...
Page 1 of 2