Concerns/BuildsQueries.php
public function eachById(callable $callback, $count = 1000, $column = null, $alias = null)
    {
        return $this->chunkById($count, function ($results) use ($callback) {
            foreach ($results as $key => $value) {
                if ($callback($value, $key) === false) {
                    return false;
                }
            }
        }, $column, $alias);
    }
public function eachById(callable $callback, $count = 1000, $column = null, $alias = null)
    {
        return $this->chunkById($count, function ($results) use ($callback) {
            foreach ($results as $key => $value) {
                if ($callback($value, $key) === false) {
                    return false;
                }
            }
        }, $column, $alias);
    }
public function eachById ( callable $ callback , $ count = 1000 , $ column = null , $ alias = null ) { return $ this -> chunkById ( $ count , function ( $ results ) use ( $ callback ) { foreach ( $ results as $ key => $ value ) { if ( $ callback ( $ value , $ key ) === false ) { return false ; } } } , $ column , $ alias ) ; }
Execute a callback over each item while chunking by id.

@param  callable  $callback
@param  int  $count
@param  string  $column
@param  string  $alias
@return bool
Execute a callback over each item while chunking by id .