do6po/laravel-cursor-chunk
最新稳定版本:1.0.1
Composer 安装命令:
composer require do6po/laravel-cursor-chunk
包简介
An easy way to get chunked data from database by cursor functional.
README 文档
README
An easy way to get chunked data from database by cursor functional.
Installation
The package can be installed via composer:
composer require do6po/laravel-cursor-chunk
If you are using Laravel version <= 5.4
or the package discovery
is disabled, add the following providers in config/app.php:
'providers' => [ Do6po\LaravelCursorChunk\Providers\CursorChunkServiceProvider::class, ]
Using
$builder = User::query(); //... some code with builder foreach ($builder->cursorChunk() as $users) { //some action with $users }
use Illuminate\Database\Eloquent\Collection; $builder = User::query(); //... some code with builder $action = fn(Collection $users, User $user) => $users->put($user->getKey(), $user); foreach ($builder->cursorChunk(1000, $action) as $users) { //some action with $users, chunked by 1000 models and key by id }
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 131
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-20