3 года назад
История
README.md
Collections
# Introduction
# Creating Collections
# Extending Collections
# Available Methods
For the majority of the remaining collection documentation, we’ll discuss each method available on the Collection class. Remember, all of these methods may be chained to fluently manipulate the underlying array. Furthermore, almost every method returns a new Collection instance, allowing you to preserve the original copy of the collection when necessary
Higher Order Messages
Method Listing
# all
The all method returns the underlying array represented by the collection:
use Upside\Collection;
$collection = new Collection();
$collection->collect([1, 2, 3])->all();
// [1, 2, 3]
# average
Alias for the avg method.
# avg
The avg method returns the average value of a given key:
use Upside\Collection;
$collection = new Collection([
['foo' => 10],
['foo' => 10],
['foo' => 20],
['foo' => 40]
]);
$average = $collection->avg('foo');
// 20
$collection = new Collection([1, 1, 2, 4]);
$average = $collection->avg();
// 2
# chunk
use Upside\Collection;
# chunkWhile
use Upside\Collection;
# collapse
use Upside\Collection;
# collect
use Upside\Collection;
# combine
use Upside\Collection;
# concat
use Upside\Collection;
# contains
use Upside\Collection;
# containsStrict
use Upside\Collection;
# count
use Upside\Collection;
# countBy
use Upside\Collection;
# crossJoin
use Upside\Collection;
# dd
use Upside\Collection;
# diff
use Upside\Collection;
# diffAssoc
use Upside\Collection;
# diffKeys
use Upside\Collection;
# dump
use Upside\Collection;
# duplicates
use Upside\Collection;
# duplicatesStrict
use Upside\Collection;
# each
use Upside\Collection;
# eachSpread
use Upside\Collection;
# every
use Upside\Collection;
# except
use Upside\Collection;
# filter
use Upside\Collection;
# first
use Upside\Collection;
# firstWhere
use Upside\Collection;
# flatMap
use Upside\Collection;
# flatten
use Upside\Collection;
# flip
use Upside\Collection;
# forget
use Upside\Collection;
# forPage
use Upside\Collection;
# get
use Upside\Collection;
# groupBy
use Upside\Collection;
# has
use Upside\Collection;
# implode
use Upside\Collection;
# intersect
use Upside\Collection;
# intersectByKeys
use Upside\Collection;
# isEmpty
use Upside\Collection;
# isNotEmpty
use Upside\Collection;
# join
use Upside\Collection;
# keyBy
use Upside\Collection;
# keys
use Upside\Collection;
# last
use Upside\Collection;
# macro
use Upside\Collection;
# make
use Upside\Collection;
# map
use Upside\Collection;
# mapInto
use Upside\Collection;
# mapSpread
use Upside\Collection;
# mapToGroups
use Upside\Collection;
# mapWithKeys
use Upside\Collection;
# max
use Upside\Collection;
# median
use Upside\Collection;
# merge
use Upside\Collection;
# mergeRecursive
use Upside\Collection;
# min
use Upside\Collection;
# mode
use Upside\Collection;
# nth
use Upside\Collection;
# only
use Upside\Collection;
# pad
use Upside\Collection;
# partition
use Upside\Collection;
# pipe
use Upside\Collection;
# pipeInto
use Upside\Collection;
# pluck
use Upside\Collection;
# pop
use Upside\Collection;
# prepend
use Upside\Collection;
# pull
use Upside\Collection;
# push
use Upside\Collection;
# put
use Upside\Collection;
# random
use Upside\Collection;
# reduce
use Upside\Collection;
# reject
use Upside\Collection;
# replace
use Upside\Collection;
# replaceRecursive
use Upside\Collection;
# reverse
use Upside\Collection;
# search
use Upside\Collection;
# shift
use Upside\Collection;
# shuffle
use Upside\Collection;
# sliding
use Upside\Collection;
# skip
use Upside\Collection;
# skipUntil
use Upside\Collection;
# skipWhile
use Upside\Collection;
# slice
use Upside\Collection;
# sole
use Upside\Collection;
# some
use Upside\Collection;
# sort
use Upside\Collection;
# sortBy
use Upside\Collection;
# sortByDesc
use Upside\Collection;
# sortDesc
use Upside\Collection;
# sortKeys
use Upside\Collection;
# sortKeysDesc
use Upside\Collection;
# splice
use Upside\Collection;
# split
use Upside\Collection;
# splitIn
use Upside\Collection;
# sum
use Upside\Collection;
# take
use Upside\Collection;
# takeUntil
use Upside\Collection;
# takeWhile
use Upside\Collection;
# tap
use Upside\Collection;
# times
use Upside\Collection;
# toArray
use Upside\Collection;
# toJson
use Upside\Collection;
# transform
use Upside\Collection;
# union
use Upside\Collection;
# unique
use Upside\Collection;
# uniqueStrict
use Upside\Collection;
# unless
use Upside\Collection;
# unlessEmpty
use Upside\Collection;
# unlessNotEmpty
use Upside\Collection;
# unwrap
use Upside\Collection;
# values
use Upside\Collection;
# when
use Upside\Collection;
# whenEmpty
use Upside\Collection;
# whenNotEmpty
use Upside\Collection;
# where
use Upside\Collection;
# whereStrict
use Upside\Collection;
# whereBetween
use Upside\Collection;
# whereIn
use Upside\Collection;
# whereInStrict
use Upside\Collection;
# whereInstanceOf
use Upside\Collection;
# whereNotBetween
use Upside\Collection;
# whereNotIn
use Upside\Collection;
# whereNotInStrict
use Upside\Collection;
# whereNotNull
use Upside\Collection;
# whereNull
use Upside\Collection;
# wrap
use Upside\Collection;
# zip
use Upside\Collection;
Описание
Конвейеры
0 успешных
0 с ошибкой