Showing 10 of 2,145 results.

Example Use | Laravel 5: String Translation Public API

The following code examples will demonstrate the usage of the has method. The results of method call will appear above the method call as a comment. 1 // Get a translator instance from the Service Container. 2 $ translator = app ( ' translator ' )...

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

Laravel Collection Public API: each

each(callable $callback) The each method accepts a $callback which will be called on each item in the collection. If the $callback returns false , the each method will break from its iterator and return a reference back to the original Collection...