canedoc / laravel-bulk-update
Installs: 7 129
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2025-05-26 02:37:45 UTC
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.