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

Eloquent Phpunit Laravel Package

erikgall/eloquent-phpunit

Eloquent PHPUnit adds convenient PHPUnit integration for Eloquent models, reducing boilerplate around test setup and database assertions. It helps you verify model behavior and persistence cleanly, making Laravel or standalone Eloquent test suites faster to write and easier to maintain.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Quality gating for the data layer. The v1.0.7 addition of a hasOne relationship test method extends relationship-contract testing to one-to-one associations, which are frequently the most business-critical links (user→profile, order→invoice, account→settings). Teams can now assert one-to-one wiring in CI rather than discovering breakage in production.
  • Build vs. buy. The package replaces hand-rolled assertInstanceOf/reflection-based relationship assertions scattered across test suites. A maintained helper is cheaper than the internal DSL most teams eventually build, and the hasOne gap was the main reason teams kept custom tests for one-to-one relations.
  • Refactor safety / roadmap confidence. Safe to schedule ORM upgrades, model renames, and namespace moves: relationship definitions become regression-tested contracts rather than implicit conventions.
  • Use cases. Model relationship coverage in CI; onboarding and code review checklists; enforcing domain-modeling standards across squads; complementing factory/schema tests.

When to Consider This Package

Adopt when:

  • You have a meaningful number of Eloquent models where relationship correctness affects business logic or API contracts.
  • You already run PHPUnit/Pest in CI and want relationship coverage without writing custom assertions per model.
  • One-to-one relations are part of your domain (v1.0.7 makes these testable with the same ergonomics as existing helpers).
  • You want consistency across teams rather than per-squad testing conventions.

Look elsewhere when:

  • Your models are few or relationships are trivial — the dependency overhead outweighs the benefit.
  • You rely primarily on static analysis (e.g. Larastan) plus database constraints for the same guarantees.
  • You need verification against live data or cross-service contracts; this is a definition-level testing tool, not an integration harness.
  • Package maintenance and release cadence are a governance concern — assess maintainer activity and versioning discipline before standardizing.

Release-specific note: v1.0.7 is additive and non-breaking. It closes a coverage gap rather than changing behavior, so no migration work is required for existing adopters.

How to Pitch It (Stakeholders)

For executives: A small, low-cost testing dependency that reduces the risk of silently broken data relationships reaching customers. The latest release adds one-to-one relationship coverage, so the standard now applies uniformly across our models — no new spend, no migration effort, incremental risk reduction.

For engineering: v1.0.7 adds a hasOne relationship test method, bringing one-to-one relations to parity with existing relationship helpers. It's a drop-in addition — no config changes, no breaking changes. Recommended action: adopt the new helper in models with one-to-one relations, and note it in the testing standards doc so new models include the assertion by default.

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.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core