elipzis/laravel-pastable-model
Quickly duplicate Eloquent models in Laravel. Paste attribute values from an existing record into a new model while controlling which fields carry over, making record cloning and repeat data entry simple and configurable.
Architecture fit
laravel-pastable-model is a small, single-purpose Laravel package that adds a trait to Eloquent models so records can be "pasted" (duplicated/cloned, optionally with relationships). v0.2.0 is a platform-support release: it moves the package's supported floor to PHP 8.2+ / Laravel 11. That is the entirety of the change — the five listed items are Dependabot bumps to GitHub Actions used in CI, not to runtime libraries.
Architecturally this is a low-coupling, low-surface-area dependency. It does not introduce service providers with global behaviour, middleware, queues, or storage. It composes into the model layer, which is where our domain logic already lives. For a TPM, the important framing is that this package is convenience logic, not infrastructure: its blast radius is limited to the models that use the trait.
The real architectural question is not "is this package well-built" but "does duplication logic belong in a third-party trait or in our own domain layer." Duplication is deceptively business-ruled — which attributes are copied, which are reset (IDs, timestamps, slugs, statuses), which relations cascade, and who is recorded as the author. A generic trait forces those decisions into model configuration; if our rules are non-trivial, we will end up wrapping the trait anyway.
Integration feasibility
Straightforward for a Laravel 11 codebase. Add the Composer dependency, use the trait on the target models, configure the duplicable attributes/relations per model, and call the paste method from a controller, action, or artisan command. No frontend, queue, or infrastructure work is implied. Realistic effort for a first vertical slice: 1–3 engineering days, most of which is spent writing per-model configuration and tests rather than wiring the package.
Feasibility collapses to zero on Laravel 10 or PHP 8.1. This release is a hard compatibility gate — there is no version of v0.2.0 that runs on our prior stack, and (per the changelog) no indication that a Laravel 10-compatible line will be maintained.
Technical risk
Key questions
Stack fit
Fits cleanly only on Laravel 11 with PHP 8.2+. Confirm the full matrix before planning: application runtime, queue workers, scheduled task hosts, local Docker/dev containers, and CI runner images. A single Laravel 10 service in the estate means this package cannot be shared across the monorepo, which in turn argues for keeping it scoped to one application rather than a shared internal package.
Note the mismatch risk in the release itself: the changelog is dominated by CI action bumps, and the "Bump PHP and Laravel to 11" change is described only in the title. There is no migration note, no composer.json diff in the notes, and no stated breaking-change callout. Treat the constraint as real but verify it against composer.json on the tag rather than trusting the summary.
Migration path
Greenfield adoption, not a migration — there is no existing assessment or installed base, so we are choosing to introduce it.
Compatibility
Hard-gated to Laravel 11 / PHP 8.2+. Database-agnostic in principle, but duplication behaviour must be validated against our specific engine (MySQL/Postgres) for unique-constraint and transaction semantics. Interacts with anything that observes model events — audit logging, search indexing, webhook dispatch — since cloning fires created events. If we run observers that assume human-authored records, they will fire on duplicates and must be reviewed explicitly.
Sequencing
Do the Laravel 11 upgrade first and independently, ship it, and only then evaluate this package. Bundling a framework major upgrade with a new dependency makes rollback of either one impossible and muddies the post-incident picture. After the upgrade lands: spike → wrap → one production model → expand. Target roughly one sprint end-to-end for a single use case, with expansion as background work. Do not sequence this ahead of higher-value Laravel 11 work; it is a convenience, not a blocker.
Maintenance
Ongoing cost is low in code volume but concentrated in a dependency we do not control. Expect to track Laravel major releases against this package's publication cadence — realistically, a recurring "is it compatible yet?" gate on every future framework upgrade. Version-pin exactly (e.g. 0.2.*) rather than floating, given 0.x semver semantics. Budget a small quarterly check: is the repo still alive, has a 1.0 shipped, are issues answered.
Support
No commercial support, no SLA, community issues only. Acceptable for internal admin tooling; unacceptable as a dependency of a customer-facing critical path with contractual uptime obligations. Internal ownership should sit with the backend team that owns the affected models — not with platform, since this is model-layer domain logic.
Scaling
Negligible runtime footprint: duplication is a bounded, synchronous, per-request operation, not a hot path. The scaling concern is data volume, not throughput — if duplication is offered on records with large relation graphs (hundreds of children, attached media), a naive clone becomes a long transaction and an N+1 factory. Cap relation depth, run inside an explicit transaction, and consider queuing duplication for large graphs. Also watch for accidental multiplication of storage via duplicated file attachments (copying the DB row without copying the blob, or copying both and doubling storage cost).
Failure modes
Ramp-up
Very low. Any Laravel developer reads the trait's usage in under an hour; the real onboarding is domain knowledge — which fields should reset on duplication. That knowledge lives with product/domain owners, not with the package. Plan one short design session per model to agree the duplication contract, and encode it as tests so it survives staff turnover.
Recommendation for the TPM: adopt v0.2.0 conditionally — only after the Laravel 11 upgrade is complete, only behind an internal wrapper, and only for internal/admin duplication rather than a customer-facing "copy" feature. The release itself is unremarkable and low-risk; the risk is entirely in the version coupling and the bus factor, both of which are cheap to mitigate if handled at integration time and expensive to fix later.
How can I help you explore Laravel packages today?