chenfeizhou / laravel-model-batch-insert
Laravel 模型批量插入
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:lib
This package is auto-updated.
Last update: 2025-03-27 16:54:53 UTC
README
Laravel 模型数据批量插入
使用指南
composer require chenfeizhou/laravel-model-batch-insert
php artisan vendor:publish --provider="Chenfeizhou\ModelBatch\ModelBatchServiceProvider"
使用
// 模型中引用 class Example extends Model { use Chenfeizhou\ModelBatch\Model\Concerns\ModelBathInsertTrait; } $data = [ [ 'name' => 'zhangsan', 'age' => '14' ], [ 'name' => 'lisi', 'age' => '15' ] ]; Example::batchInsert($data);