定制 canedoc/laravel-bulk-update 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

canedoc/laravel-bulk-update

Composer 安装命令:

composer require canedoc/laravel-bulk-update

包简介

README 文档

README

This pachake add multi row update to Laravel Query Builder. It supports Laravel >= 9.

Installation

You can install the package via composer:

composer require canedoc/laravel-bulk-update

Usage

allow multi row update in one query.

In this example all rows in animes table that have : 1- email = 'aruto@best.com' and name = 'naruto' the age will be set to 33. 2- 'name' = 'sasuki' the email will be set to 'sasuki@best.com' 3- all rows will set is_alive to true

$data = [
    'age' => [
        ['email' => 'naruto@best.com', 'name' => 'naruto', 'age' => 33],
    ],
    'email' => ['email' => 'sasuki@best.com', 'name' => 'sasuki'],
    'is_alive' => true
]

\DB::table('animes')->where('is_active', true)->bulkUpdate($data);

Animes::where('is_active', true)->bulkUpdate($data);

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 9.67k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-25