October\Rain\Support\Collection
Overview
Collection is an umbrella class for Laravel's Collection
Extends
- Illuminate\Support\Collection
Implements
- Illuminate\Contracts\Support\Arrayable
- Countable
- IteratorAggregate
- Illuminate\Contracts\Support\Jsonable
- JsonSerializable
- Stringable
- Traversable
- Illuminate\Support\Enumerable
- Illuminate\Contracts\Support\CanBeEscapedWhenCastToString
- ArrayAccess
Protected Properties
There are no protected properties in the class.
Show inherited protected properties
Inherited Protected Properties
- $items - The items contained in the collection. (defined in Illuminate\Support\Collection)
- $escapeWhenCastingToString - Indicates that the object's string representation should be escaped when __toString is invoked. (defined in Illuminate\Support\Collection)
- $proxies - The methods that can be proxied. (defined in Illuminate\Support\Collection)
- $macros - The registered string macros. (defined in Illuminate\Support\Collection)
Public Methods
public lists()
public lists(string $value, string $key = null): array
lists get an array with the values of a given key
Inherited Public Methods
- __call() - Dynamically handle calls to the class. (defined in Illuminate\Support\Collection)
- __callStatic() - Dynamically handle calls to the class. (defined in Illuminate\Support\Collection)
- __construct() - Create a new collection. (defined in Illuminate\Support\Collection)
- __get() - Dynamically access collection proxies. (defined in Illuminate\Support\Collection)
- __toString() - Convert the collection to its string representation. (defined in Illuminate\Support\Collection)
- add() - Add an item to the collection. (defined in Illuminate\Support\Collection)
- after() - Get the item after the given item. (defined in Illuminate\Support\Collection)
- all() - Get all of the items in the collection. (defined in Illuminate\Support\Collection)
- average() - Alias for the "avg" method. (defined in Illuminate\Support\Collection)
- avg() - Get the average value of a given key. (defined in Illuminate\Support\Collection)
- before() - Get the item before the given item. (defined in Illuminate\Support\Collection)
- chunk() - Chunk the collection into chunks of the given size. (defined in Illuminate\Support\Collection)
- chunkBy() - Chunk the collection into chunks by comparing adjacent values using the given key or callback. (defined in Illuminate\Support\Collection)
- chunkWhile() - Chunk the collection into chunks with a callback. (defined in Illuminate\Support\Collection)
- collapse() - Collapse the collection of items into a single array. (defined in Illuminate\Support\Collection)
- collapseWithKeys() - Collapse the collection of items into a single array while preserving its keys. (defined in Illuminate\Support\Collection)
- collect() - Collect the values into a collection. (defined in Illuminate\Support\Collection)
- combine() - Create a collection by using this collection for keys and another for its values. (defined in Illuminate\Support\Collection)
- concat() - Push all of the given items onto the collection. (defined in Illuminate\Support\Collection)
- contains() - Determine if an item exists in the collection. (defined in Illuminate\Support\Collection)
- containsManyItems() - Determine if the collection contains multiple items. (defined in Illuminate\Support\Collection)
- containsOneItem() - Determine if the collection contains exactly one item. If a callback is provided, determine if exactly one item matches the condition. (defined in Illuminate\Support\Collection)
- containsStrict() - Determine if an item exists, using strict comparison. (defined in Illuminate\Support\Collection)
- count() - Count the number of items in the collection. (defined in Illuminate\Support\Collection)
- countBy() - {@inheritDoc}. (defined in Illuminate\Support\Collection)
- crossJoin() - Cross join with the given lists, returning all possible permutations. (defined in Illuminate\Support\Collection)
- dd() - Dump the given arguments and terminate execution. (defined in Illuminate\Support\Collection)
- diff() - Get the items in the collection that are not present in the given items. (defined in Illuminate\Support\Collection)
- diffAssoc() - Get the items in the collection whose keys and values are not present in the given items. (defined in Illuminate\Support\Collection)
- diffAssocUsing() - Get the items in the collection whose keys and values are not present in the given items, using the callback. (defined in Illuminate\Support\Collection)
- diffKeys() - Get the items in the collection whose keys are not present in the given items. (defined in Illuminate\Support\Collection)
- diffKeysUsing() - Get the items in the collection whose keys are not present in the given items, using the callback. (defined in Illuminate\Support\Collection)
- diffUsing() - Get the items in the collection that are not present in the given items, using the callback. (defined in Illuminate\Support\Collection)
- doesntContain() - Determine if an item is not contained in the collection. (defined in Illuminate\Support\Collection)
- doesntContainStrict() - Determine if an item is not contained in the enumerable, using strict comparison. (defined in Illuminate\Support\Collection)
- dot() - Flatten a multi-dimensional associative array with dots. (defined in Illuminate\Support\Collection)
- dump() - Dump the items. (defined in Illuminate\Support\Collection)
- duplicates() - Retrieve duplicate items from the collection. (defined in Illuminate\Support\Collection)
- duplicatesStrict() - Retrieve duplicate items from the collection using strict comparison. (defined in Illuminate\Support\Collection)
- each() - Execute a callback over each item. (defined in Illuminate\Support\Collection)
- eachSpread() - Execute a callback over each nested chunk of items. (defined in Illuminate\Support\Collection)
- empty() - Create a new instance with no items. (defined in Illuminate\Support\Collection)
- ensure() - Ensure that every item in the collection is of the expected type. (defined in Illuminate\Support\Collection)
- escapeWhenCastingToString() - Indicate that the model's string representation should be escaped when __toString is invoked. (defined in Illuminate\Support\Collection)
- every() - Determine if all items pass the given truth test. (defined in Illuminate\Support\Collection)
- except() - Get all items except for those with the specified keys. (defined in Illuminate\Support\Collection)
- filter() - Run a filter over each of the items. (defined in Illuminate\Support\Collection)
- first() - Get the first item from the collection passing the given truth test. (defined in Illuminate\Support\Collection)
- firstOrFail() - Get the first item in the collection but throw an exception if no matching items exist. (defined in Illuminate\Support\Collection)
- firstWhere() - Get the first item by the given key value pair. (defined in Illuminate\Support\Collection)
- flatMap() - Map a collection and flatten the result by a single level. (defined in Illuminate\Support\Collection)
- flatten() - Get a flattened array of the items in the collection. (defined in Illuminate\Support\Collection)
- flip() - Flip the items in the collection. (defined in Illuminate\Support\Collection)
- flushMacros() - Flush the existing macros. (defined in Illuminate\Support\Collection)
- forPage() - "Paginate" the collection by slicing it into a smaller collection. (defined in Illuminate\Support\Collection)
- forget() - Remove an item from the collection by key. (defined in Illuminate\Support\Collection)
- fromJson() - Create a new collection by decoding a JSON string. (defined in Illuminate\Support\Collection)
- get() - Get an item from the collection by key. (defined in Illuminate\Support\Collection)
- getCachingIterator() - Get a CachingIterator instance. (defined in Illuminate\Support\Collection)
- getIterator() - Get an iterator for the items. (defined in Illuminate\Support\Collection)
- getOrPut() - Get an item from the collection by key or add it to collection if it does not exist. (defined in Illuminate\Support\Collection)
- groupBy() - {@inheritDoc}. (defined in Illuminate\Support\Collection)
- has() - Determine if an item exists in the collection by key. (defined in Illuminate\Support\Collection)
- hasAny() - Determine if any of the keys exist in the collection. (defined in Illuminate\Support\Collection)
- hasMacro() - Checks if macro is registered. (defined in Illuminate\Support\Collection)
- hasMany() - Determine if the collection contains multiple items, optionally matching the given criteria. (defined in Illuminate\Support\Collection)
- hasSole() - Determine if the collection contains a single item, optionally matching the given criteria. (defined in Illuminate\Support\Collection)
- implode() - Concatenate values of a given key as a string. (defined in Illuminate\Support\Collection)
- intersect() - Intersect the collection with the given items. (defined in Illuminate\Support\Collection)
- intersectAssoc() - Intersect the collection with the given items with additional index check. (defined in Illuminate\Support\Collection)
- intersectAssocUsing() - Intersect the collection with the given items with additional index check, using the callback. (defined in Illuminate\Support\Collection)
- intersectByKeys() - Intersect the collection with the given items by key. (defined in Illuminate\Support\Collection)
- intersectUsing() - Intersect the collection with the given items, using the callback. (defined in Illuminate\Support\Collection)
- isEmpty() - Determine if the collection is empty or not. (defined in Illuminate\Support\Collection)
- isNotEmpty() - Determine if the collection is not empty. (defined in Illuminate\Support\Collection)
- join() - Join all items from the collection using a string. The final items can use a separate glue string. (defined in Illuminate\Support\Collection)
- jsonSerialize() - Convert the object into something JSON serializable. (defined in Illuminate\Support\Collection)
- keyBy() - {@inheritDoc}. (defined in Illuminate\Support\Collection)
- keys() - Get the keys of the collection items. (defined in Illuminate\Support\Collection)
- last() - Get the last item from the collection. (defined in Illuminate\Support\Collection)
- lazy() - Get a lazy collection for the items in this collection. (defined in Illuminate\Support\Collection)
- macro() - Register a custom macro. (defined in Illuminate\Support\Collection)
- make() - Create a new collection instance if the value isn't one already. (defined in Illuminate\Support\Collection)
- map() - Run a map over each of the items. (defined in Illuminate\Support\Collection)
- mapInto() - Map the values into a new class. (defined in Illuminate\Support\Collection)
- mapSpread() - Run a map over each nested chunk of items. (defined in Illuminate\Support\Collection)
- mapToDictionary() - Run a dictionary map over the items. (defined in Illuminate\Support\Collection)
- mapToGroups() - Run a grouping map over the items. (defined in Illuminate\Support\Collection)
- mapWithKeys() - Run an associative map over each of the items. (defined in Illuminate\Support\Collection)
- max() - Get the max value of a given key. (defined in Illuminate\Support\Collection)
- median() - Get the median of a given key. (defined in Illuminate\Support\Collection)
- merge() - Merge the collection with the given items. (defined in Illuminate\Support\Collection)
- mergeRecursive() - Recursively merge the collection with the given items. (defined in Illuminate\Support\Collection)
- min() - Get the min value of a given key. (defined in Illuminate\Support\Collection)
- mixin() - Mix another object into the class. (defined in Illuminate\Support\Collection)
- mode() - Get the mode of a given key. (defined in Illuminate\Support\Collection)
- multiply() - Multiply the items in the collection by the multiplier. (defined in Illuminate\Support\Collection)
- nth() - Create a new collection consisting of every n-th element. (defined in Illuminate\Support\Collection)
- offsetExists() - Determine if an item exists at an offset. (defined in Illuminate\Support\Collection)
- offsetGet() - Get an item at a given offset. (defined in Illuminate\Support\Collection)
- offsetSet() - Set the item at a given offset. (defined in Illuminate\Support\Collection)
- offsetUnset() - Unset the item at a given offset. (defined in Illuminate\Support\Collection)
- only() - Get the items with the specified keys. (defined in Illuminate\Support\Collection)
- pad() - Pad collection to the specified length with a value. (defined in Illuminate\Support\Collection)
- partition() - Partition the collection into two arrays using the given callback or key. (defined in Illuminate\Support\Collection)
- percentage() - Calculate the percentage of items that pass a given truth test. (defined in Illuminate\Support\Collection)
- pipe() - Pass the collection to the given callback and return the result. (defined in Illuminate\Support\Collection)
- pipeInto() - Pass the collection into a new class. (defined in Illuminate\Support\Collection)
- pipeThrough() - Pass the collection through a series of callable pipes and return the result. (defined in Illuminate\Support\Collection)
- pluck() - Get the values of a given key. (defined in Illuminate\Support\Collection)
- pop() - Get and remove the last N items from the collection. (defined in Illuminate\Support\Collection)
- prepend() - Push an item onto the beginning of the collection. (defined in Illuminate\Support\Collection)
- proxy() - Add a method to the list of proxied methods. (defined in Illuminate\Support\Collection)
- pull() - Get and remove an item from the collection. (defined in Illuminate\Support\Collection)
- push() - Push one or more items onto the end of the collection. (defined in Illuminate\Support\Collection)
- put() - Put an item in the collection by key. (defined in Illuminate\Support\Collection)
- random() - Get one or a specified number of items randomly from the collection. (defined in Illuminate\Support\Collection)
- range() - Create a collection with the given range. (defined in Illuminate\Support\Collection)
- reduce() - Reduce the collection to a single value. (defined in Illuminate\Support\Collection)
- reduceInto() - Reduce the collection to a single value by mutating an initial value. (defined in Illuminate\Support\Collection)
- reduceSpread() - Reduce the collection to multiple aggregate values. (defined in Illuminate\Support\Collection)
- reduceWithKeys() - Reduce an associative collection to a single value. (defined in Illuminate\Support\Collection)
- reject() - Create a collection of all elements that do not pass a given truth test. (defined in Illuminate\Support\Collection)
- replace() - Replace the collection items with the given items. (defined in Illuminate\Support\Collection)
- replaceRecursive() - Recursively replace the collection items with the given items. (defined in Illuminate\Support\Collection)
- reverse() - Reverse items order. (defined in Illuminate\Support\Collection)
- search() - Search the collection for a given value and return the corresponding key if successful. (defined in Illuminate\Support\Collection)
- select() - Select specific values from the items within the collection. (defined in Illuminate\Support\Collection)
- shift() - Get and remove the first N items from the collection. (defined in Illuminate\Support\Collection)
- shuffle() - Shuffle the items in the collection. (defined in Illuminate\Support\Collection)
- skip() - Skip the first {$count} items. (defined in Illuminate\Support\Collection)
- skipUntil() - Skip items in the collection until the given condition is met. (defined in Illuminate\Support\Collection)
- skipWhile() - Skip items in the collection while the given condition is met. (defined in Illuminate\Support\Collection)
- slice() - Slice the underlying collection array. (defined in Illuminate\Support\Collection)
- sliding() - Create chunks representing a "sliding window" view of the items in the collection. (defined in Illuminate\Support\Collection)
- sole() - Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception. (defined in Illuminate\Support\Collection)
- some() - Alias for the "contains" method. (defined in Illuminate\Support\Collection)
- sort() - Sort through each item with a callback. (defined in Illuminate\Support\Collection)
- sortBy() - Sort the collection using the given callback. (defined in Illuminate\Support\Collection)
- sortByDesc() - Sort the collection in descending order using the given callback. (defined in Illuminate\Support\Collection)
- sortDesc() - Sort items in descending order. (defined in Illuminate\Support\Collection)
- sortKeys() - Sort the collection keys. (defined in Illuminate\Support\Collection)
- sortKeysDesc() - Sort the collection keys in descending order. (defined in Illuminate\Support\Collection)
- sortKeysUsing() - Sort the collection keys using a callback. (defined in Illuminate\Support\Collection)
- splice() - Splice a portion of the underlying collection array. (defined in Illuminate\Support\Collection)
- split() - Split a collection into a certain number of groups. (defined in Illuminate\Support\Collection)
- splitIn() - Split a collection into a certain number of groups, and fill the first groups completely. (defined in Illuminate\Support\Collection)
- sum() - Get the sum of the given values. (defined in Illuminate\Support\Collection)
- take() - Take the first or last {$limit} items. (defined in Illuminate\Support\Collection)
- takeUntil() - Take items in the collection until the given condition is met. (defined in Illuminate\Support\Collection)
- takeWhile() - Take items in the collection while the given condition is met. (defined in Illuminate\Support\Collection)
- tap() - Pass the collection to the given callback and then return it. (defined in Illuminate\Support\Collection)
- times() - Create a new collection by invoking the callback a given amount of times. (defined in Illuminate\Support\Collection)
- toArray() - Get the collection of items as a plain array. (defined in Illuminate\Support\Collection)
- toBase() - Get a base Support collection instance from this collection. (defined in Illuminate\Support\Collection)
- toJson() - Get the collection of items as JSON. (defined in Illuminate\Support\Collection)
- toPrettyJson() - Get the collection of items as pretty print formatted JSON. (defined in Illuminate\Support\Collection)
- toResourceCollection() - Create a new resource collection instance for the given resource. (defined in Illuminate\Support\Collection)
- transform() - Transform each item in the collection using a callback. (defined in Illuminate\Support\Collection)
- undot() - Convert a flatten "dot" notation array into an expanded array. (defined in Illuminate\Support\Collection)
- union() - Union the collection with the given items. (defined in Illuminate\Support\Collection)
- unique() - Return only unique items from the collection array. (defined in Illuminate\Support\Collection)
- uniqueStrict() - Return only unique items from the collection array using strict comparison. (defined in Illuminate\Support\Collection)
- unless() - Apply the callback if the given "value" is (or resolves to) falsy. (defined in Illuminate\Support\Collection)
- unlessEmpty() - Apply the callback unless the collection is empty. (defined in Illuminate\Support\Collection)
- unlessNotEmpty() - Apply the callback unless the collection is not empty. (defined in Illuminate\Support\Collection)
- unshift() - Prepend one or more items to the beginning of the collection. (defined in Illuminate\Support\Collection)
- unwrap() - Get the underlying items from the given collection if applicable. (defined in Illuminate\Support\Collection)
- value() - Get a single key's value from the first matching item in the collection. (defined in Illuminate\Support\Collection)
- values() - Reset the keys on the underlying array. (defined in Illuminate\Support\Collection)
- when() - Apply the callback if the given "value" is (or resolves to) truthy. (defined in Illuminate\Support\Collection)
- whenEmpty() - Apply the callback if the collection is empty. (defined in Illuminate\Support\Collection)
- whenNotEmpty() - Apply the callback if the collection is not empty. (defined in Illuminate\Support\Collection)
- where() - Filter items by the given key value pair. (defined in Illuminate\Support\Collection)
- whereBetween() - Filter items such that the value of the given key is between the given values. (defined in Illuminate\Support\Collection)
- whereIn() - Filter items by the given key value pair. (defined in Illuminate\Support\Collection)
- whereInStrict() - Filter items by the given key value pair using strict comparison. (defined in Illuminate\Support\Collection)
- whereInstanceOf() - Filter the items, removing any items that don't match the given type(s). (defined in Illuminate\Support\Collection)
- whereNotBetween() - Filter items such that the value of the given key is not between the given values. (defined in Illuminate\Support\Collection)
- whereNotIn() - Filter items by the given key value pair. (defined in Illuminate\Support\Collection)
- whereNotInStrict() - Filter items by the given key value pair using strict comparison. (defined in Illuminate\Support\Collection)
- whereNotNull() - Filter items where the value for the given key is not null. (defined in Illuminate\Support\Collection)
- whereNull() - Filter items where the value for the given key is null. (defined in Illuminate\Support\Collection)
- whereStrict() - Filter items by the given key value pair using strict comparison. (defined in Illuminate\Support\Collection)
- wrap() - Wrap the given value in a collection if applicable. (defined in Illuminate\Support\Collection)
- zip() - Zip the collection together with one or more arrays. (defined in Illuminate\Support\Collection)
Protected Methods
Show inherited protected methods
Inherited Protected Methods
- duplicateComparator() - Get the comparison function to detect duplicates. (defined in Illuminate\Support\Collection)
- equality() - Make a function to check an item's equality. (defined in Illuminate\Support\Collection)
- getArrayableItems() - Results array of items from Collection or Arrayable. (defined in Illuminate\Support\Collection)
- guessResourceCollection() - Guess the resource collection for the items. (defined in Illuminate\Support\Collection)
- identity() - Make a function that returns what's passed to it. (defined in Illuminate\Support\Collection)
- negate() - Make a function using another function, by negating its result. (defined in Illuminate\Support\Collection)
- newInstance() - Create a new instance of the collection. (defined in Illuminate\Support\Collection)
- operatorForWhere() - Get an operator checker callback. (defined in Illuminate\Support\Collection)
- resolveResourceCollectionFromAttribute() - Get the resource collection class from the class attribute. (defined in Illuminate\Support\Collection)
- resolveResourceFromAttribute() - Get the resource class from the class attribute. (defined in Illuminate\Support\Collection)
- sortByMany() - Sort the collection using multiple comparisons. (defined in Illuminate\Support\Collection)
- useAsCallable() - Determine if the given value is callable, but not a string. (defined in Illuminate\Support\Collection)
- valueRetriever() - Get a value retrieving callback. (defined in Illuminate\Support\Collection)