Search

Showing 7 of 2,041 result(s)

/blog/2018/02/20/laravel-5-string-translation-public-api#content-example-use-5

Pluralization of strings is a complicated problem to solve. The table located at https://www.unicode.org/cldr/charts/25/supplemental/language_plural_rules.html gives a sense of the differences between different locales and the rules of...

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

avg($key = null) The avg method is a useful method for calculating the average of all items in the collection. The avg method defines an optional $key parameter, which can be used to specify what property of the collection should be averaged. If...

/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/2018/04/11/laravel-5-creating-combinations-of-elements-with-crossjoin

The crossJoin method can be used to combine the input arrays; the resulting array will contain all of the possible combinations of the input array values.The signature of the crossJoin method is: If you are unfamiliar with the ...$arrays syntax,...

/blade-parser/v1/compilation-targets

The compiler implementation supports the concept of "compilation targets." Compilation targets instruct the compiler to change its behavior depending on where the resulting PHP code is used. Currently, the following compilation targets are...

/blog/2014/07/19/procedure-vs-function-vs-method-vs#content-anonymous-functions

Again, we might be in a world of hurt here. Anonymous functions are a kind of different breed of functions. Let's look at an example in JavaScript (ECMAScript for you technical type): The above code runs in the context of the web browser (so we...

/blog/2014/06/25/lambdas-and-closures#content-but-why

These anonymous functions are useful when we as developers need to do something right then and there, but do not necessarily want, or need to create a dedicated function for the task. Like when we define routes in Laravel, it would be cumbersome...