Search

Showing 7 of 1,975 result(s)

/blog/2018/04/22/laravel-5-collections-reducing-a-multi-dimensional-collection-to-a-single-dimension-losing-keys-with-flatten

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...

/blog/2018/04/22/laravel-5-collections-reversing-the-order-of-collection-elements-with-reverse

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...

/blog/2021/11/07/creating-a-statamic-compact-modifier#content-basic-structure-of-modifiers

…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,...

/social-media-image-kit/v1/custom-renderers

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...

/blog/2018/04/22/laravel-5-collections-calculating-the-sum-of-a-collection-with-sum#content-signature

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...

/blog/2023/04/10/creating-a-custom-statamic-layout-tag#content-getting-started

…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,...

/blog/2016/11/30/laravel-collection-public-api-zip

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...