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

Laravel Repository Laravel Package

jetbox/laravel-repository

jetbox/laravel-repository provides a lightweight repository pattern for Laravel, helping separate data access from business logic. Define interfaces, bind implementations, and keep Eloquent queries organized, reusable, and easier to test.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for the data-access layer. This package is a candidate only for the "buy" side of a decision you're probably already facing: do we formalize a repository layer across our Laravel services, and do we adopt a library or write a ~150-line internal base class? The package is small enough that "buy" and "build" cost roughly the same — which reframes the decision around maintenance ownership rather than feature coverage. The v0.1.6 release (Laravel 10/11 support) removes the main compatibility objection for teams on current Laravel, so the "buy" option is now technically viable on modern stacks — but the ownership argument is unchanged.
  • Whether to introduce a repository abstraction at all. The strongest product outcome here is often a decision not to adopt. Evaluating this package forces an explicit answer to "what problem is the repository layer solving for us?" — swappable data sources, query reuse, testability, or just convention. If the answer is "convention," Eloquent plus scoped query objects is cheaper and the package adds indirection without a payoff.
  • Roadmap sequencing for a data-layer refactor. If you have a planned migration (read replicas, a move off MySQL, an external search index, or a service extraction), a repository seam is what makes that migration a config change instead of a cross-cutting rewrite. This package lets you spike that seam cheaply to size the refactor before committing a quarter to it — and as of v0.1.6 you can now run that spike on Laravel 10/11 rather than pinning to an older framework.
  • Testability and onboarding investment. A repository interface gives unit tests a seam to fake persistence without a database, and gives new engineers one obvious place to look for data access. That's a real (if modest) velocity argument for platform teams with high contributor churn.
  • Feature scoping for multi-source reads. If the next 2–3 quarters include reading from a secondary store (cache, search index, partner API), a repository contract is the cheapest way to keep that out of controllers and jobs. This package is a template for that contract, not a full implementation of it.

When to Consider This Package

Adopt (or, more accurately, borrow from) it when:

  • You have already decided the repository pattern is warranted — e.g., a concrete, funded migration off a single datastore, or a compliance requirement to isolate persistence.
  • You are on Laravel 10 or 11. v0.1.6 added framework support for both, so a compatibility pin is no longer a reason to skip the evaluation — but confirm the package's own test matrix covers your framework and PHP versions before relying on it.
  • The consuming surface is internal tooling, admin panels, or a non-revenue service where a dependency failure is a nuisance, not an incident.
  • You are willing to vendor the code or fork it rather than depend on it. With ~43 stars, 0 dependents, and a single maintainer, a framework-support bump is a liveness signal, not a community signal — this is still not a dependency you want on a critical path, but it remains a perfectly good reference implementation to copy, adapt, and own.
  • You're time-boxing a 1–2 day spike to estimate a broader refactor and want a working baseline instead of a blank file.

Look elsewhere when:

  • The code sits on a revenue path, a multi-tenant boundary, or anything with an internal SLA. One release widening framework compatibility does not mean anybody has stress-tested this against your edge cases; the maintenance risk is unquantifiable rather than merely high.
  • You need features beyond a thin Eloquent wrapper: caching decorators, criteria/filter pipelines, pagination abstractions, or transaction management. Evaluate spatie/laravel-query-builder (for filtering/sorting) and prettus/l5-repository (larger, older, more feature-complete community) — but note the latter is also aging.
  • Your team is small and Eloquent-native. The repository pattern's cost is real (extra layer, more files, temptation to leak query builder semantics through interfaces) and the benefit is conditional. Writing your own 100-line BaseRepository gives you 90% of the value with zero supply-chain surface.
  • You can't commit an owner. Any adopted package without an internal owner is technical debt with a delay fuse; with 0 dependents, upstream breakage will not be caught by the community for you. A patch release that only adds framework support suggests the maintainer is responsive, not that the package will keep pace with future Laravel majors.

Positioning: treat this as a pattern library to evaluate, not a product dependency to install. v0.1.6 makes the evaluation cheaper (no version pinning); it does not change the conclusion.

How to Pitch It (Stakeholders)

For executives (30 seconds): We evaluated a small open-source library that adds a standard data-access layer to our Laravel services. It's a ~43-star, single-maintainer package — a recent patch added support for Laravel 10 and 11, which is a good sign but still too thin a community to depend on for anything customer-facing. Recommendation: don't take it as a dependency; use it as a reference design for a small internal abstraction we own. Cost is roughly 1–2 engineer-days, versus an unbounded cross-cutting refactor later if we need to change or add a data source. The decision here is about sequencing a refactor, not about adopting a vendor.

For engineering leads: This is a thin Eloquent wrapper — interfaces plus a base repository. v0.1.6 added Laravel 10/11 support, so we can prototype against our current stack rather than a pinned older version; that removes the compatibility blocker from the last review. It's still not a general-purpose dependency: 0 dependents, single maintainer, release cadence driven by framework bumps rather than feature work. Proposed path: fork or reimplement the contract internally, assign an owner, and gate adoption on a specific near-term migration (read replicas, search index, external API, or test isolation). If we can't name that migration, we should skip the layer entirely — the indirection cost is not justified by convention alone. If we do need a richer feature set, compare against Spatie's query builder before writing anything.

Ask: approve a 2-day spike to prototype the seam against one real service on Laravel 11, with a go/no-go on the full rollout once we can name the migration it unblocks.

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.
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
jinas/dhivatar
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