src/Helpers.php
public static function partition($items, callable $callback)
    {
        $partitions = [new Collection, new Collection];

        foreach ($items as $key => $item) {
            $partitions[(int) ! $callback($item, $key)][$key] = $item;
        }

        return new Collection($partitions);
    }
public static function partition($items, callable $callback)
    {
        $partitions = [new Collection, new Collection];

        foreach ($items as $key => $item) {
            $partitions[(int) ! $callback($item, $key)][$key] = $item;
        }

        return new Collection($partitions);
    }
public static function partition ( $ items , callable $ callback ) { $ partitions = [ new Collection , new Collection ] ; foreach ( $ items as $ key => $ item ) { $ partitions [ ( int ) ! $ callback ( $ item , $ key ) ] [ $ key ] = $ item ; } return new Collection ( $ partitions ) ; }
Partition the given collection into two collection using the given callback.

@param  iterable  $items
@param  callable  $callback
@return \Illuminate\Support\Collection
Partition the given collection into two collection using the given callback .