Showing 10 of 2,055 results.

Laravel Artisan General Command: The optimize Command

The optimize command optimizes various aspects to improve the performance of the Laravel application. The command provides two flags. The --force flag can be set to indicate that the compiled class file should be written (by default the compiled...

Laravel Translation Helper: trans_choice

The trans_choice helper function is used to pluralize a given $id , translating it for the given $locale . The choice method accepts the $number of some collection of objects that it should use when making pluralization decisions. Like the trans...

Laravel 5: Randomizing Element Order With shuffle

The shuffle method can be used to shuffle an input array and then returns the results. This method takes advantage of PHP's shuffle method; therefore, it is not suitable for cryptographic purposes.The signature of the shuffle method is: 1 public...

Laravel Collection Public API: sortBy

sortBy($callback, $options = SORT_REGULAR, $descending = false) The sortBy method is useful and versatile way to sort collections by some key, or by some value returned by a $callback . The $callback can either be a function that defines two...

Laravel 5: Checking if a Variable Holds a Value With filled

…is, boolean, ,, The value is a, Countable, object and contains items,, the PHP, empty, evaluates to, falseThe signature of the filled function is: 1 function filled ( 2 $ value 3 ) ;The following example demonstrates the basic usage of the filled...

has($key, $locale = null) | The Laravel Translator

The has method determines if a translation exists. It accepts a $key , which corresponds to an array key within the translation group file, i.e., user . The method also accepts a $locale , which can be used to determine if a given key exists for a...