Methods |
public
|
chunk(int $count, callable $callback): bool
Chunk the results of the query.
Chunk the results of the query.
|
#
|
public
|
chunkMap(callable $callback, int $count = 1000): Collection
Run a map over each item while chunking.
Run a map over each item while chunking.
|
#
|
public
|
each(callable $callback, int $count = 1000): bool
Execute a callback over each item while chunking.
Execute a callback over each item while chunking.
Throws
|
#
|
public
|
chunkById(int $count, callable $callback, string|null $column = null, string|null $alias = null): bool
Chunk the results of a query by comparing IDs.
Chunk the results of a query by comparing IDs.
|
#
|
public
|
eachById(callable $callback, int $count = 1000, string|null $column = null, string|null $alias = null): bool
Execute a callback over each item while chunking by ID.
Execute a callback over each item while chunking by ID.
|
#
|
public
|
lazy(int $chunkSize = 1000): LazyCollection
Query lazily, by chunks of the given size.
Query lazily, by chunks of the given size.
Throws
|
#
|
public
|
lazyById(int $chunkSize = 1000, string|null $column = null, string|null $alias = null): LazyCollection
Query lazily, by chunking the results of a query by comparing IDs.
Query lazily, by chunking the results of a query by comparing IDs.
Throws
|
#
|
public
|
lazyByIdDesc(int $chunkSize = 1000, string|null $column = null, string|null $alias = null): LazyCollection
Query lazily, by chunking the results of a query by comparing IDs in descending order.
Query lazily, by chunking the results of a query by comparing IDs in descending order.
Throws
|
#
|
public
|
first(array|string $columns = ['*']): Model|object|static|null
Execute the query and get the first result.
Execute the query and get the first result.
|
#
|
public
|
sole(array|string $columns = ['*']): Model|object|static|null
Execute the query and get the first result if it's the sole matching record.
Execute the query and get the first result if it's the sole matching record.
Throws
|
#
|
public
|
tap(callable $callback): $this|mixed
Pass the query to a given callback.
Pass the query to a given callback.
|
#
|