The
last
function returns the last element in the given array:
$array = [100, 200, 300];
$last = last($array);
$last = last($array);
public function qualifySubSelectColumn($column)
{
return $this->getRelationName().'.'.last(explode('.', $column));
}
{
return $this->getRelationName().'.'.last(explode('.', $column));
}
public function getMorphType()
{
return last(explode('.', $this->morphType));
}
{
return last(explode('.', $this->morphType));
}
protected function whereInMethod(Model $model, $key)
{
return $model->getKeyName() === last(explode('.', $key))
&& in_array($model->getKeyType(), ['int', 'integer'])
? 'whereIntegerInRaw'
: 'whereIn';
{
return $model->getKeyName() === last(explode('.', $key))
&& in_array($model->getKeyType(), ['int', 'integer'])
? 'whereIntegerInRaw'
: 'whereIn';
$separator = str_contains(strtolower($column), ' as ') ? ' as ' : '\.';
return last(preg_split('~'.$separator.'~i', $column));
}
return last(preg_split('~'.$separator.'~i', $column));
}
$min = $this->parameter(head($having['values']));
$max = $this->parameter(last($having['values']));
return $column.' '.$between.' '.$min.' and '.$max;
}
$max = $this->parameter(last($having['values']));
return $column.' '.$between.' '.$min.' and '.$max;
}
protected function compileDeleteWithJoins(Builder $query, $table, $where)
{
$alias = last(explode(' as ', $table));
$joins = $this->compileJoins($query, $query->joins);
{
$alias = last(explode(' as ', $table));
$joins = $this->compileJoins($query, $query->joins);
protected function compileUpdateColumns(Builder $query, array $values)
{
return collect($values)->map(function ($value, $key) {
$column = last(explode('.', $key));
if ($this->isJsonSelector($key)) {
return $this->compileJsonUpdateColumn($column, $value);
{
return collect($values)->map(function ($value, $key) {
$column = last(explode('.', $key));
if ($this->isJsonSelector($key)) {
return $this->compileJsonUpdateColumn($column, $value);
$columns = $this->compileUpdateColumns($query, $values);
$alias = last(preg_split('/\s+as\s+/i', $query->from));
$selectSql = $this->compileSelect($query->select($alias.'.ctid'));
$alias = last(preg_split('/\s+as\s+/i', $query->from));
$selectSql = $this->compileSelect($query->select($alias.'.ctid'));
{
$table = $this->wrapTable($query->from);
$alias = last(preg_split('/\s+as\s+/i', $query->from));
$selectSql = $this->compileSelect($query->select($alias.'.ctid'));
$table = $this->wrapTable($query->from);
$alias = last(preg_split('/\s+as\s+/i', $query->from));
$selectSql = $this->compileSelect($query->select($alias.'.ctid'));
return collect($values)->reject(function ($value, $key) {
return $this->isJsonSelector($key);
})->merge($jsonGroups)->map(function ($value, $key) use ($jsonGroups) {
$column = last(explode('.', $key));
$value = isset($jsonGroups[$key]) ? $this->compileJsonPatch($column, $value) : $this->parameter($value);
return $this->isJsonSelector($key);
})->merge($jsonGroups)->map(function ($value, $key) use ($jsonGroups) {
$column = last(explode('.', $key));
$value = isset($jsonGroups[$key]) ? $this->compileJsonPatch($column, $value) : $this->parameter($value);
$columns = $this->compileUpdateColumns($query, $values);
$alias = last(preg_split('/\s+as\s+/i', $query->from));
$selectSql = $this->compileSelect($query->select($alias.'.rowid'));
$alias = last(preg_split('/\s+as\s+/i', $query->from));
$selectSql = $this->compileSelect($query->select($alias.'.rowid'));
{
$table = $this->wrapTable($query->from);
$alias = last(preg_split('/\s+as\s+/i', $query->from));
$selectSql = $this->compileSelect($query->select($alias.'.rowid'));
$table = $this->wrapTable($query->from);
$alias = last(preg_split('/\s+as\s+/i', $query->from));
$selectSql = $this->compileSelect($query->select($alias.'.rowid'));
protected function compileUpdateWithJoins(Builder $query, $table, $columns, $where)
{
$alias = last(explode(' as ', $table));
$joins = $this->compileJoins($query, $query->joins);
{
$alias = last(explode(' as ', $table));
$joins = $this->compileJoins($query, $query->joins);
: $options->backoff
);
return (int) ($backoff[$job->attempts() - 1] ?? last($backoff));
}
);
return (int) ($backoff[$job->attempts() - 1] ?? last($backoff));
}
$base = $this->getResourceWildcard(last(explode('.', $name)));
$defaults = $this->resourceDefaults;
$defaults = $this->resourceDefaults;