Search

Showing 7 of 1,975 result(s)

/blade-parser/v1/compiling-custom-component-tags

The default behavior of the compiler is to treat all custom component tags as if they were "normal" Blade component tags. However, we can provide custom compilers for our specific component tag prefixes and return custom-compiled output. We create...

/blog/2016/11/21/laravel-miscellaneous-helper-function-data_set

…name) of the data to set and the $value to be set. It also defines an optional $overwrite parameter (which is set to true by default). If $overwrite is set to true , any existing values for the $key will be replaced. The following code example...

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

…mply passing in a value for the $key parameter. The value of $key must correspond to some key or property of the nested arrays or objects: After the above code has been executed, the $averagePrice variable would contain the value 449.99 . The avg...

/blog/2018/04/22/laravel-5-collections-reducing-a-collection-to-one-element-with-reduce

The reduce method is to reduce a collection into only one item. It does this by iterating over the collection and applying the $callback function on each element. The $callback function should define two parameters: $carry and $item . The $carry...

/blog/2014/06/25/lambdas-and-closures#content-lambdas-as-function-arguments

…etical scenario, we can be thankful that there is a built in PHP function named array_filter . This function filters elements of an array using a callback function . That callback function will be the lambda function that you pass in as an...

/blog/2016/11/30/creating-a-hashing-manager-for-our-custom-laravel-hashing-implementations

…ider For Our Custom laravel Hashing Implementations The goal of this hashing manager class is to be able to write code that looks like the following: With the goals in mind we have a few options. We can explicitly create all the member and static...

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

whereIn($key, array $values, $strict = true) The whereIn method is used to filter the collection based on a given $key and an array of the possible $values that the $key can have. The method also defines an optional $strict parameter, which when...