Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Advanced Upsert For Laravel Laravel Package

viktorruskai/advanced-upsert-for-laravel

Advanced upsert functionality for Laravel, extending Eloquent's bulk insert-or-update capabilities with flexible conflict handling so you can efficiently sync large datasets without repetitive queries.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy on bulk-write plumbing: If the roadmap includes high-volume import, sync, or ETL-style workflows (CSV imports, third-party catalog syncs, nightly reconciliation jobs), this package is a candidate to replace hand-rolled insertOrIgnore/upsert loops and per-row save() calls. The decision is narrow — it competes with "write 30 lines of query-builder code" more than with a paid vendor.
  • Performance/scale work already on the roadmap: Upsert batching is usually a latency and DB-load lever, not a feature. Useful to justify a spike when support tickets or dashboards point at write-heavy endpoints or queue workers timing out on large syncs.
  • Ergonomics of internal data pipelines: 1.0.1 adds support for Illuminate\Support\Collection inputs. That is a small but real product signal: teams can pass results of ->map(), ->filter(), chunked queries, or Eloquent collection pipelines straight into an upsert without a ->toArray() conversion step. It reduces the surface area where a well-intentioned ->toArray() on a nested/chunked collection silently mangles data.
  • Roadmap fit for "sync" features: Any planned feature framed as "keep our table in step with source X" (inventory levels, pricing, entitlements, contact records from a CRM) is directly enabled. The Collection support matters most here, because sync code is typically built as collection transformations.
  • Use cases that are not well served: Anything needing change-data-capture, audit trails of what changed per row, conflict resolution policies, or cross-database portability guarantees. Upsert semantics differ by driver (MySQL ON DUPLICATE KEY, Postgres ON CONFLICT, SQLite variants), and that is a product-visible difference in behavior, not just an implementation detail.

When to Consider This Package

Adopt when most of the following hold:

  • You have a concrete, measured bulk-write workload — thousands of rows per job or request — where per-row Eloquent saves are the bottleneck.
  • Your team is already on MySQL or PostgreSQL and you are willing to accept driver-specific upsert behavior (which columns get updated on conflict, how timestamps are handled, what happens on multi-unique-key tables).
  • You want collection-native ergonomics in pipeline code; 1.0.1 makes Collection a first-class input, which is the version to standardize on if you adopt.
  • The upsert logic is not the core of your product; it is plumbing you would rather not maintain.

Look elsewhere or hold when:

  • Maturity risk is unacceptable. This is a 1.0.x package with a single maintainer and a small PR history. For a payment-, billing-, or compliance-critical write path, prefer a maintained first-party pattern (Laravel's native upsert() on the query builder / Eloquent has existed since 8.x) or an in-house wrapper you control.
  • Laravel's native upsert() already covers you. Before adopting, do the honest comparison: native upsert($values, $uniqueBy, $update) handles a large share of real needs. The gap this package fills is convenience and driver-specific options, not a fundamental capability.
  • You need multi-database support (e.g. MySQL in prod, SQLite in tests, Postgres in analytics) and cannot tolerate behavioral drift between them.
  • You need observability and safe rollout. There are no stated guarantees here around chunking, transaction behavior, or memory ceilings on very large collections — treat those as things your team must verify, not assume.
  • You cannot pin and vendor it. Given the release cadence, pin an exact version and be prepared to fork.

How to Pitch It (Stakeholders)

To executives: A small, low-cost open-source utility that makes high-volume database writes (imports, syncs, nightly jobs) significantly cheaper than row-by-row saves. The 1.0.1 release is an incremental ergonomics improvement — you can now feed Laravel collections directly into it, which trims boilerplate from our data-pipeline code. It is not a platform bet; treat it as a tactical dependency decision with a clear exit (Laravel's native upsert, or a thin in-house wrapper) if the package stalls. Recommend a scoped pilot on one non-critical sync job before broader use.

To engineering: Version 1.0.1 adds Collection support alongside the existing array input, so ->map()/->filter() pipelines can call the upsert directly. The ask is a timeboxed spike: benchmark against native upsert() on our real dataset, confirm driver-specific conflict semantics match our expectations on multi-unique-key tables, and verify chunking/memory behavior on our largest job. Pin the exact version, and if the spike shows no meaningful win over native upsert(), we skip the dependency — the goal is the outcome, not the package. Flag the single-maintainer risk and decide up front who owns the fork if needed.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib