Showing 10 of 1,278 results.

Laravel Collection Public API: splice

splice($offset, $length = null, $replacement = []) The splice method is a versatile method; it is often used to remove a portion of a collection and return the removed section. It defines three parameters: $offset , $length and $replacement . The...

Laravel Collection Public API: search

search($value, $strict = false) The search method is used to search the collection for a given $value . If the given $value is found, the value's corresponding key is returned. If the $value is not found in the collection, the search method will...

Laravel 5: Throwing HTTP Exceptions With abort

The abort function will throw an instance of Symfony\Component\HttpKernel\Exception\HttpException with the given $code , $message and any $headers supplied. These exceptions can be caught and handled through the application's kernel. If the $code...

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 Artisan Command Input and Command Signatures

Most useful commands need to accept some sort of input from the user. The input can be as simple as requiring users to supply information in the form of parameters and options or can be more complicated by interactively entering data at the...

Laravel 5.5 String Helper Method: finish

The finish helper method will make sure that a given $value always ends with exactly one occurrence of the $cap . This helper method is incredibly useful when construction URIs or file paths. The $cap can be any string of characters, and does not...

Filter Search