Search

Showing 7 of 1,975 result(s)

/blog/2016/11/29/laravel-collection-public-api-contains

contains($key, $value = null) The contains method is used to determine if a given $key exists within the collection. Additionally, an option $value can be specified that will be used to check if a given key/value pair exists within the collection....

/blog/2016/11/20/laravel-helper-function-env

…get an environment variables value. If an environment value with the given $key exists, its value will be returned. If the given $key does not exist, the $default value will be returned instead, which is null by default. The following examples...

/blog/2018/04/22/laravel-5-collections-converting-a-collection-into-something-json-serializeable-with-jsonserialize

The jsonSerialize method will convert the contents of the collection into something that be serialized using PHP's json_encode function. This method will iterate the collection's internal array and will evaluate each element in accordance with the...

/blog/2018/04/22/laravel-5-collections-merging-multiple-collection-values-with-merge

The merge methods merges the given $items with the items in the collection. The merge method will replace any item in the original collection's items if a string key with the same value exists in the supplied $items . If the $items keys are...

/blog/2018/04/22/laravel-5-collections-retrieving-and-removing-the-last-collection-element-with-pop

The pop method is used to retrieve the last item from the collection while also removing it from the collection. If there are no items in the collection, the pop method will return null . The pop method modifies the collection instance it is...

/blog/2016/11/29/laravel-collection-public-api-first

first(callable $callback = null, $default = null) The first method is used to get the first item in a collection, or to get the first item in a collection that matches a set of criteria. A $callback can be supplied to return the first item in the...

/blog/2021/02/20/integrating-laravel-spark-and-statamic-3#content-configuring-stripe-and-spark-creating-our-product

…options. After we have created this Stripe product we will then update our project's Spark configuration to use these product and plan identifiers, as well as a number of environment variables so that Stripe can communicate with our website via....