Showing 7 of 1,975 result(s)
The values method can be used to retrieve a new Collection instance containing only the values of the original collection instance. The keys of the new collection will be reset to consecutive numerical keys, starting at zero. The behavior of the...
To have our custom error page show up we need to temporarily update our .env file and adjust the value of the APP_DEBUG entry to false : If your custom error page still does not appear, it is likely that your project's configuration values have...
The containsStrict method is similar to the contains method; it acts as a shortcut to calling the contains method with a strict comparison operator.The following examples demonstrate the behavior of the containsStrict method: After the above code...
The contains method can also be used with higher order messaging, which allows us to invoke collection methods and access properties on objects using PHP's property accessors syntax. In the following example, we will modify the User class we...
The pluck method is used to retrieve the a list of values from the collection. It defines two parameters: $value and $key . The $value indicates which property should become the value in the resulting collection and the $key parameter indicates...
…voked, as well as the data from the item being iterated., se_is_set_type, The se_is_set_type modifier is a utility modifier that can be used to easily check if a Bard or replicator field contains a specific set at some arbitrary position. As an...
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...