Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Set the internal pointer of an array to its first element
reset(array|object &$array): mixed
$key = key($pair);
$value = reset($pair);
if (! isset($dictionary[$key])) {
$dictionary[$key] = [];
$value = reset($pair);
if (! isset($dictionary[$key])) {
$dictionary[$key] = [];
function head($array)
{
return reset($array);
}
}
{
return reset($array);
}
}
public function whereBetween($key, $values)
{
return $this->where($key, '>=', reset($values))->where($key, '<=', end($values));
}
{
return $this->where($key, '>=', reset($values))->where($key, '<=', end($values));
}
public function whereNotBetween($key, $values)
{
return $this->filter(function ($item) use ($key, $values) {
return data_get($item, $key) < reset($values) || data_get($item, $key) > end($values);
});
}
{
return $this->filter(function ($item) use ($key, $values) {
return data_get($item, $key) < reset($values) || data_get($item, $key) > end($values);
});
}
throw new MultipleColumnsSelectedException;
}
return reset($record);
}
}
return reset($record);
}
return 0;
}
if (! is_array(reset($values))) {
$values = [$values];
}
}
if (! is_array(reset($values))) {
$values = [$values];
}
}
if (is_null($update)) {
$update = array_keys(reset($values));
}
return $this->toBase()->upsert(
if (is_null($update)) {
$update = array_keys(reset($values));
}
return $this->toBase()->upsert(
$name = explode(':', key($relation))[0];
if (is_string(reset($relation))) {
$relation = reset($relation);
}
if (is_string(reset($relation))) {
$relation = reset($relation);
}
$name = explode(':', key($relation))[0];
if (is_string(reset($relation))) {
$relation = reset($relation);
}
$models->filter(function ($model) use ($name) {
if (is_string(reset($relation))) {
$relation = reset($relation);
}
$models->filter(function ($model) use ($name) {
if (count($relations) === 0 || $relations === [[]]) {
return [];
} elseif (count($relations) === 1) {
return reset($relations);
} else {
return array_intersect(...array_values($relations));
}
return [];
} elseif (count($relations) === 1) {
return reset($relations);
} else {
return array_intersect(...array_values($relations));
}
{
$value = $dictionary[$key];
return $type === 'one' ? reset($value) : $this->related->newCollection($value);
}
$value = $dictionary[$key];
return $type === 'one' ? reset($value) : $this->related->newCollection($value);
}
if (isset($dictionary[$key = $this->getDictionaryKey($model->getAttribute($this->localKey))])) {
$value = $dictionary[$key];
$model->setRelation(
$relation, reset($value)
);
}
}
$value = $dictionary[$key];
$model->setRelation(
$relation, reset($value)
);
}
}
{
$result = (array) $this->first([$column]);
return count($result) > 0 ? reset($result) : null;
}
$result = (array) $this->first([$column]);
return count($result) > 0 ? reset($result) : null;
}
{
$result = (array) $this->sole([$column]);
return reset($result);
}
$result = (array) $this->sole([$column]);
return reset($result);
}
return true;
}
if (! is_array(reset($values))) {
$values = [$values];
}
}
if (! is_array(reset($values))) {
$values = [$values];
}