src/Base/Support/Collection.php
/**
     * Run a filter over each of the items.
     *
     * @param  callable|null  $callback
     * @return static
     */
Run a filter over each of the items.
@param  callable|null  $callback
@return static
Run a filter over each of the items . @param callable|null $callback @return static
public function filter(callable $callback = null)
    {
        if ($callback) {
            return new static(Arr::where($this->items, $callback));
        }
        return new static(array_filter($this->items));
    }
public function filter ( callable $ callback = null ) { if ( $ callback ) { return new static ( Arr :: where ( $ this -> items , $ callback ) ) ; } return new static ( array_filter ( $ this -> items ) ) ; }
Run a filter over each of the items.
Run a filter over each of the items .