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

Persisted Objects Laravel Package

everzet/persisted-objects

A lightweight PHP library for persisting domain objects as event streams. It records state changes as events and rebuilds objects by replaying them, offering a simple event-sourced alternative to traditional ORM mapping. Use it to keep model changes explicit and auditable without a heavy persistence...

Deep Wiki
Context7

Technical Evaluation

Architecture fit. This is a test-automation utility, not application infrastructure. It provides a small named-object registry with an explicit lifecycle (persist, retrieve, purge) so that fixtures created in one execution step remain addressable in later steps without threading return values through parameters. That model maps cleanly onto Behat/Codeception-style step definitions. It maps poorly onto the dominant Laravel testing idiom (PHPUnit/Pest), where TestCase instance properties, RefreshDatabase, and the service container already provide scoped, framework-aware state. Treat it as a narrow convenience layer for multi-step BDD suites running against a Laravel app — not a general fixture-management strategy.

Integration feasibility. Composer-installable as a require-dev dependency. The gating issue is the last release date (February 2018): the published constraint almost certainly targets PHP 5.6/7.x, while Laravel 9/10/11 require PHP 8.0+. Expect composer require to fail without a fork with a widened php constraint or --ignore-platform-req. Mitigating this: the codebase is small (a handful of classes), so forking or vendoring is hours of work, not weeks. Integration is a setUp/tearDown (or Pest beforeEach/afterEach) hook plus a bootstrap line.

Technical risk. Contained and reversible. There is no production attack surface if it stays in require-dev and is never autoloaded outside tests. The real risks are: abandonment (no maintainer response), PHP 8.2+ dynamic-property and deprecation notices, and an untyped API that converts mistakes into runtime errors rather than static-analysis errors. The blast radius is limited to test reliability, not customer-facing behavior.

Key questions to resolve before committing:

  • What is the exact public API and purge semantics — is cleanup per-scenario, per-process, or manual?
  • Does it interoperate with Laravel's container, or is it a parallel registry requiring discipline to avoid key collisions?
  • How does it behave under ParaTest/parallel workers and long-lived processes?
  • Is the license permissive enough to fork and publish internally?
  • Does the team actually have multi-step suites, or is this solving a problem we do not have?

Integration Approach

Stack fit. Dev-only, test-only. Install to require-dev, keep usage confined to tests/, and wire lifecycle calls into the base TestCase or Behat context hooks rather than into application code. Namespace keys (e.g., user.admin, order.pending) to avoid collision with container bindings.

Migration path. Do not migrate the existing PHPUnit suite — factories, model states, and typed test properties are strictly better there. Adopt additively in the one place it earns its keep: step-based suites where a fixture must survive across step boundaries. The migration is a few lines in a context or base class, and removal is equally cheap, which is the main argument for trying it.

Compatibility. Validate against the actual matrix before rollout: the target Laravel version, the PHP version in CI, and the PHP version developers run locally. Confirm fork-pinned constraint resolves, confirm no deprecation noise at E_ALL, and confirm the purge hook fires when a test fails or errors (the common leak path).

Sequencing.

  1. Time-boxed spike in a single branch against the real PHP/Laravel versions.
  2. Decide fork vs. vendor vs. drop, based on whether the constraint resolves and whether purge semantics match our suite.
  3. If proceeding, pin a fork, add a CI job that installs from a clean cache, and document conventions.
  4. Roll out to one suite, measure flake rate before and after.
  5. Expand only if the flake rate improves.

Operational Impact

Maintenance. Effectively zero upstream activity; ownership transfers to us on adoption. Budget roughly one engineer-day for the fork plus a recurring quarterly check against new PHP releases. This is the single largest cost and it is small but permanent.

Support. No vendor, no SLA, no maintainer responsiveness for six-plus years. Escalation path is a GitHub issue that will not be answered; the internal fork is the support model. Mitigate with an internal owner named in the repo.

Scaling. In-memory and per-process, so it scales with suite size rather than with traffic. Two constraints: parallel workers each hold isolated state (correct, but means cross-worker sharing is impossible and should not be assumed), and long-running or non-purged processes accumulate object references until memory pressure appears. Verify the purge is scoped per scenario, not per process.

Failure modes to design against.

  • Stale objects surviving between scenarios, producing order-dependent, intermittently failing tests — the classic symptom and the one most likely to erode trust.
  • Silent no-op when the purge hook is misconfigured or skipped on exception paths.
  • Type mismatches from untyped retrieval surfacing far from the call site.
  • composer install breaking on a PHP upgrade because the fork's constraint was not maintained.

Ramp-up. Low. The API surface is small enough that a mid-level engineer is productive in under an hour. The risk is knowledge concentration: the purge lifecycle and fork rationale are non-obvious and easy to break, so document them in the test README and keep the fork under normal code review.

Recommendation. The score reflects abandonment and low adoption, not poor design. Adopt only as a dev-only convenience inside step-based BDD suites, behind a pinned fork, with a named owner and a documented exit path. If the team is PHPUnit/Pest-centric — which most Laravel teams are — the correct decision is to skip it and use native test-case state.

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.
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings