Search

Showing 7 of 1,216 result(s)

/blog/2018/04/15/laravel-5-setting-array-or-object-values-with-data_set

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

/blog/2018/04/15/laravel-5-setting-data-on-objects-without-overwriting-existing-data-with-data_fill

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

/blog/2018/04/21/laravel-5-fluent-api-the-public-api

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

/blog/2018/04/21/laravel-5-getting-specific-messages-with-get

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

/blog/2018/04/21/laravel-5-macros-call-and-callstatic

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

/blog/2018/04/21/laravel-5-macros-creating-callback-macros

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

/blog/2018/04/21/laravel-5-macros-defining-a-callback-function-macro-with-macro

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