Showing 7 of 1,216 result(s)
The data_set helper function can be used to set the value of an item in an array or an object property using dot notation. It accepts a reference to a $target array or object; the $key (array key or object property name) of the data to set and the...
The data_fill helper function accomplishes the same fundamental task as the data_set helper function. The only difference is that the data_fill does not define an optional $overwrite parameter. data_fill internally makes a call to the data_set...
The following sections will highlight the usage of the various public methods that the Fluent class provides. There are, however, some omissions in this section, namely the methods required to implement PHP's ArrayAccess interface. The examples...
The get method can be used to retrieve all the messages for a given $key with the specified $format . The $format is null by default, which will cause the get method to use the format stored within the MessageBag instance (which can be retrieved...
The Macroable trait implements PHP's magic __call method to intercept calls to methods when in object context that do not exist in the current class. If a macro with the given method name is found, it is evaluated and the result returned. If no...
The first method of creating macros we will explore is the callback function macro. These macros are added to the various classes directly by calling the macro method on the macroable class and then supplying the callback function that will be...
The macro method is used to add a callback function macro to any class that utilize the "Illuminate\Support\Traits\Macroable" trait.The signature of the macro method is:The following example demonstrates how to add a new method chunk to the...