Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Set the internal pointer of an array to its last element
end(array|object &$array): mixed
    public static function last($array, callable $callback null$default null)

    {

        if (
is_null($callback)) {

            return empty(
$array) ? value($default) : end($array);

        }



        return static::
first(array_reverse($arraytrue), $callback$default);
        }



        if (
count($array) === 1) {

            return 
end($array);

        }



        
$finalItem array_pop($array);
    function last($array)

    {

        return 
end($array);

    }

}
    public function whereBetween($key$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);

        });

    }
    protected function findInContextualBindings($abstract)

    {

        return 
$this->contextual[end($this->buildStack)][$abstract] ?? null;

    }
    protected function getLastParameterOverride()

    {

        return 
count($this->with) ? end($this->with) : [];

    }
        $segments preg_split('/\s+as\s+/i'$this->query->from);



        
$qualifiedColumn end($segments).'.'.$column;



        
$values[$qualifiedColumn] = Arr::get($values$qualifiedColumn$values[$column]);
            }



            if (
is_callable($value)) {

                
$path[count($segments) - 1][end($segments)] = $value;

            }



            
$this->loadMissingRelation($this$path);
    {

        
$segments explode('.'$this->getQualifiedForeignKeyName());



        return 
end($segments);

    }
        $min $this->parameter(is_array($where['values']) ? reset($where['values']) : $where['values'][0]);



        
$max $this->parameter(is_array($where['values']) ? end($where['values']) : $where['values'][1]);



        return 
$this->wrap($where['column']).' '.$between.' '.$min.' and '.$max;

    }
        $min $this->wrap(is_array($where['values']) ? reset($where['values']) : $where['values'][0]);



        
$max $this->wrap(is_array($where['values']) ? end($where['values']) : $where['values'][1]);



        return 
$this->wrap($where['column']).' '.$between.' '.$min.' and '.$max;

    }
    public function zadd($key, ...$dictionary)

    {

        if (
is_array(end($dictionary))) {

            foreach (
array_pop($dictionary) as $member => $score) {

                
$dictionary[] = $score;

                
$dictionary[] = $member;
        $prefix implode('/'array_slice($segments0, -1));



        return [
end($segments), $prefix];

    }
        $uri $this->getNestedResourceUri($segments);



        return 
str_replace('/{'.$this->getResourceWildcard(end($segments)).'}'''$uri);

    }