PHPackages                             jhavenz/laravel-batch-update - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. jhavenz/laravel-batch-update

ActiveLibrary[Database &amp; ORM](/categories/database)

jhavenz/laravel-batch-update
============================

batch updates for Eloquent models

0.0.1(3y ago)017[2 PRs](https://github.com/jhavenz/laravel-batch-updates/pulls)MITPHPPHP ^8.0

Since Oct 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/jhavenz/laravel-batch-updates)[ Packagist](https://packagist.org/packages/jhavenz/laravel-batch-update)[ Docs](https://github.com/jhavenz/laravel-batch-update)[ GitHub Sponsors](https://github.com/jhavenz)[ RSS](/packages/jhavenz-laravel-batch-update/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (4)Used By (0)

Laravel Batch Updates
---------------------

[](#laravel-batch-updates)

There's always been a missing bit when you want don't want to 'upsert', which Laravel covers, and you don't want to 'insert'. When you just need to 'update' all the rows, each having their own varying data set, then this package will help you out.

Requirements
------------

[](#requirements)

```
- PHP: >= 8.1

```

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require jhavenz/laravel-batch-update
```

Usage
-----

[](#usage)

Notes:

- This package has been used a bit in my projects and is working nicely so far, but it's still in an infant and I have to write the test suite. Please lmk if you see an issue or have an idea to add.
- I'm aware that I'm bypassing the bindings as I'm building the query, but since I'm generally using this logic when I wan to map 100s of rows, then fire the query off, I've hit limitations against the database where there's 'too many bindings' for the db engine to handle.

Thoughts?.. It's better like this, right? *Unless, of course, you're passing user input to your db... in that case, I can't imagine you'd be batch updating while the user is waiting anyway.*

---

Update multiple rows, each having their own values..and you only want to update: (not updateOrCreate, upsert, findOrCreate, etc.) e.g.

```
use Jhavenz\LaravelBatchUpdate\BatchedUpdate;

//
(new BatchedUpdate(User::class))->update(
    values: [
        [
            'user_id' => 123,
            'name' => 'john doe',
            'email' => 'john@example.com',
        ],
        [
            'user_id' => 234,
            'name' => 'jane doe',
            'email' => 'jane@example.com',
        ],
        // ... a whole bunch of mapped data (in memory), then 1 query gets executed
    ],
    index:  /** Give an index here, or leave null and the Model's key will be used  */
    quoted:  /** have you quoted the value, or should I ?..   */
);
```

Testing
-------

[](#testing)

```
#TODO - composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Jonathan Havens](https://github.com/jhavenz)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1314d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9965a727b89f751cba049ef0f53c8449974616543cee7fcf90c461bb6a6ca925?d=identicon)[jhavenz](/maintainers/jhavenz)

---

Top Contributors

[![jhavens-rcn](https://avatars.githubusercontent.com/u/168601940?v=4)](https://github.com/jhavens-rcn "jhavens-rcn (11 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (7 commits)")[![jhavenz](https://avatars.githubusercontent.com/u/53377590?v=4)](https://github.com/jhavenz "jhavenz (1 commits)")

---

Tags

jhavenzlaravel-batch-update

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/jhavenz-laravel-batch-update/health.svg)

```
[![Health](https://phpackages.com/badges/jhavenz-laravel-batch-update/health.svg)](https://phpackages.com/packages/jhavenz-laravel-batch-update)
```

###  Alternatives

[owen-it/laravel-auditing

Audit changes of your Eloquent models in Laravel

3.4k33.0M95](/packages/owen-it-laravel-auditing)[staudenmeir/eloquent-json-relations

Laravel Eloquent relationships with JSON keys

1.1k5.8M24](/packages/staudenmeir-eloquent-json-relations)[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.1M11](/packages/bavix-laravel-wallet)[dragon-code/migrate-db

Easy data transfer from one database to another

15717.4k](/packages/dragon-code-migrate-db)[gearbox-solutions/eloquent-filemaker

A package for getting FileMaker records as Eloquent models in Laravel

6454.8k2](/packages/gearbox-solutions-eloquent-filemaker)[cybercog/laravel-ownership

Laravel Ownership simplify management of Eloquent model's owner.

9126.6k3](/packages/cybercog-laravel-ownership)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
