Showing 10 of 2,055 results.

setSelector(MessageSelector $selector) | The Laravel Translator

The setSelector method sets a Symfony\Component\Translation\MessageSelector instance ( $selector ) for the Translator . The MessageSelector instance is used by the choice and transChoice methods for loading the correct translation message based on...

Using Modifiers in Antlers Dynamic Bindings

Throughout this article we will be taking a closer look at passing variables to parameters and modifiers by using dynamic binding . Dynamic binding is a technique to supply a value to a tag or modifier by referencing it's variable name. For...

Laravel Collection Public API: toJson

toJson($options = 0) The toJson method will return a JSON encoded version of the data stored within the collection instance. It internally does this by returning a call to PHP's json_encode function, passing in any $options that were supplied....

Laravel Collection Public API: keyBy

keyBy($keyBy) The keyBy method is used to create a new Collection instance where the keys of the new key/value pairs are determined by a $keyBy callback function (a string value can also be supplied instead of a function). The signature of the...

Laravel Collection Public API: merge

merge($items) The merge methods merges the given $items with the items in the collection. The merge method will replace any item in the original collection's items if a string key with the same value exists in the supplied $items . If the $items...