Showing 7 of 1,975 result(s)
The following example demonstrates the basic use of the mapSpread method. We will first create a series of numbers using PHP's range function; afterwards, we will split the collection into smaller pieces using the chunk method and then label each...
reject($callback) The reject method used to create a new Collection instance containing all the items in the collection that do not pass a given truth test. The reject method only defines one parameter: $callback . The $callback function should...
…systems like cron or Windows Task Scheduler in the sense that the actual scheduling of commands is done using Laravel's task scheduler, not with third party systems (the third party systems would then be required to call the Laravel task...
Sometimes it is useful to associate a given message number with exactly one number. In previous examples, we've seen how to handle the pluralization case where the number of items is exactly 0 , however, we can expand this idea to any arbitrary...
In the previous example, we looked many ways to call the choice method, including out to pass in replacement parameters. In many of the examples, we passed in number to indicate the number of items in a collection. The choice method will allow you...
The whereInStrict method is similar to the whereIn method; the difference is that the whereInStrict method will always use strict comparisons where determining the final collection results. The whereInStrict method does not modify the original...
The flip method will return a new Collection instance where are the all the collection item's keys have been exchanged with their corresponding values. The behavior of the flip method is similar to PHP's array_flip function.public function...