binarytorch/model-updater
Laravel package for bulk-updating Eloquent models from CSV or Excel files. Map spreadsheet columns to model attributes, match records by key, and apply changes through a simple, configurable workflow—ideal for admin data imports and maintenance.
What it is. binarytorch/model-updater is a thin convention layer over Eloquent's fill/save cycle: you hand it a model plus a payload, it filters the payload against the model's fillable attributes, validates, and persists — returning a small result object with errors. It is not infrastructure; it is a codified pattern for keeping update() logic out of controllers. The entire value proposition is roughly 200–400 lines of PHP plus a service provider.
Architecture fit. Good conceptual fit for a Laravel monolith or modular monolith that is CRUD-heavy (admin panels, internal tools, back-office APIs). It slots in where a controller would otherwise do $model->fill($request->all())->save() with ad-hoc validation. It does not fit event-sourced, CQRS, or domain-rich aggregates — it assumes Eloquent models are the write model and that mass-assignment-style updates are acceptable.
Integration feasibility. Mechanically trivial: Composer install, package auto-discovery, MIT license, no external services, no database footprint. There is no runtime infrastructure cost. The real constraint is version compatibility — the package targets the Laravel 5.5–6.x / PHP 7.x era, so it will not resolve against Laravel 9+ without constraint surgery, and it has not been tested against PHP 8.
Technical risk (high, but concentrated).
$fillable are dropped without error, which turns a misconfigured model into a silent data-loss bug rather than a 422. Confirm whether it fires saving/updating/saved events, whether it wraps in a transaction, and how it treats explicit null versus absent keys (PUT vs PATCH semantics).$fillable being correct and non-empty; teams that run $guarded = [] get an injection surface with a friendlier API.Key questions to answer before any decision.
Recommendation. Do not adopt as a dependency. Adopt the pattern: a dedicated UpdateModelAction / form-object class with an explicit authorize → validate → fill → transaction → save → event pipeline. The package's only durable asset is its naming convention, and that is free.
Stack fit. Appropriate only if the target is a Laravel 5.5–6.x application on PHP 7.x. If the estate is Laravel 9/10/11 on PHP 8.1+, treat this as a reference implementation, not a dependency — forcing the install with --ignore-platform-reqs buys a Composer constraint you will fight at every framework upgrade.
Migration path (in order of preference).
app/Support/ModelUpdater.php or a first-party laimoon/model-updater fork under our org. Keep the public method names so existing call sites do not churn. Effort: 1–2 engineer-days including tests.composer vendor the code into the repo, remove the dependency, and pin behavior with characterization tests before touching anything else.spatie/laravel-data (PHP 8.1+, Laravel 9+) covers the same ground with active maintenance, or plain Form Requests plus $model->fill($validated)->save() inside DB::transaction(). Effort: 3–5 engineer-days per domain if call sites are numerous.Compatibility notes. Auto-discovery means zero bootstrap wiring on 5.5+; on older apps, register the provider manually. There is no published support matrix beyond the 2020 timeframe — verify against the actual composer.json constraints rather than the README. If the app uses Octane, confirm the updater holds no request state in singletons.
Sequencing.
composer.json, and add a lint/CI check that new code uses the action class.Maintenance. Effectively 100% ours from day one. Upstream is archived with no release cadence; there is no "wait for a fix" option, and no CVE triage. That is acceptable for a 300-line utility and unacceptable for anything touching auth or serialization — this package touches neither, which is the main argument in its favor.
Support. No issue tracker activity, no maintainer responsiveness, 40 stars and zero dependents means no third-party validation and no Stack Overflow corpus. Onboarding documentation is the README, and its examples are written in pre-Laravel-8 idiom. Internal runbooks must be authored, not borrowed.
Scaling. Runtime cost is negligible — it is in-process PHP over an existing Eloquent save, no additional queries, no I/O. The scaling risk is organizational: every team reimplements the pattern slightly differently, producing inconsistent update semantics across services. Mitigate by promoting one internal implementation to a shared package with a version and an owner.
Failure modes to monitor.
$fillable drift — the highest-probability production bug. Add a test that asserts each endpoint's accepted field set.null, silently clearing columns on PATCH-style requests.Ramp-up. Low for the code, moderate for the convention. Any Laravel developer reads the class in under an hour. The cost is that new hires arrive knowing Form Requests and Actions and will not recognize this idiom; it becomes tribal knowledge unless the internal version is documented and enforced in review. Budget half a day of onboarding documentation and a code-review checklist item, otherwise the pattern erodes into a mixed estate where half the controllers update models directly.
Bottom line. Low technical value, low integration cost, high bus-factor, zero ecosystem. Extract the pattern, own the code, and do not let an archived 2020 dependency into a 2024+ framework upgrade path.
How can I help you explore Laravel packages today?