Showing 7 of 1,975 result(s)
The flatten method will return a new Collection instance representing a flattened version of the original collection's items. The flatten method internally makes use of the "Illuminate\Support\Arr::flatten($array)" helper method. The flatten...
The reverse method is used to reverse the order of items in a collection. The reverse method returns a new Collection instance. The reverse method does not preserve numerical keys but will preserve non-numerical keys. The reverse method is similar...
…even create an array containing all the string's characters. The following example would return the upper-cased version of the value Hello, world! : The input value for modifiers always come from the left. Modifiers can also accept parameters,...
Custom renderers allow you change how social media images are generated from HTML. Social Media Image Kit ships with a Browsershot renderer out of the box, if you landed on this page looking to change it's configuration you might consider the...
The following code example shows the simplest way to use the sum method: After the above code has executed, the $sum variable will contain the value 15 , which is indeed the sum of all the items in the collection. The following is a more...
…extensions. The command we use to do this is the make:addon command, which accepts the vendor and package name. For me, I supplied the following input to the command: php please make:addon stillat/antlers-layouts After the command has executed,...
zip($items) The zip method is used to merge the values of the $items array with the values within the Collection at the corresponding index. The zip method produces results that are similar to Python's zip function, and developer's coming from a...