Showing 10 of 1,278 results.

Laravel Collection Public API: jsonSerialize

jsonSerialize The jsonSeralize method internally returns the value of the toArray method. This method exists to implement PHP's JsonSerializable interface, which allows developers to customize how a class is represented when using the json_encode...

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

Laravel Collection Public API: every

every($step, $offset = 0) The every method can be used to retrieve a subset of a collection based on each items distance from each other. It defines one required parameter $step and one optional parameter $offset . An argument supplied for $step...

Laravel Artisan Tinker: The throw-up Command

The throw-up command can be used to re-throw an exception out of a Tinker REPL session. By default, it throws the exception that last occurred, but will accept an exception instance as an argument: 1 >>> throw new Exception("An example...

Laravel Collection Public API: slice

slice($offset, $length = null, $preserveKeys = false) The slice method is used to return a slice, or portion of the collection starting at the given $offset . The $offset tells the slice method where to begin when creating the collection. For...

Filter Search