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

prettus/laravel-repository

A Laravel repository pattern package that decouples your application logic from Eloquent. It provides base repository and interface classes, reusable query criteria, caching support, and service container bindings for cleaner, testable, and more maintainable code.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Architecture / codebase strategy: Deciding whether to standardize on a repository abstraction between controllers and Eloquent models — useful when we expect to swap or wrap data sources, add caching, or enforce query conventions centrally.
  • Build vs. buy for cross-cutting data concerns: The package bundles criteria (composable query filters), presenters (response transformation), validators, and cache-aware repositories. Each of those is a discrete "build" item; adopting the package lets us defer or avoid building them in-house.
  • Roadmap scoping for a legacy or CRUD-heavy Laravel service: It is most defensible as a fast way to give consistency to a large number of similar resource endpoints, not as a foundation for a new greenfield architecture.
  • Feature-level reuse decisions: If a team is already writing criteria/presenters by hand, the package is a candidate to consolidate that boilerplate — a small, contained refactor rather than a platform commitment.
  • Not supported: It should not drive decisions about core domain modeling, event sourcing, CQRS, or anything where the repository layer would become the system's load-bearing abstraction. The abstraction is thin and opinionated toward Eloquent.

When to Consider This Package

Consider it when:

  • We are on a Laravel version the package actually supports (verify against composer.json — this is an older, Laravel 5-era package; confirm compatibility before anything else).
  • The codebase is CRUD-dominant with repetitive query logic across many controllers, and consistency matters more than cleverness.
  • The team already knows the repository pattern and wants a conventional implementation rather than a bespoke one.
  • We need criteria-style filtering, presenters, and simple caching quickly, and the alternative is 2–4 weeks of internal scaffolding.
  • We treat it as an internal convenience layer that is easy to remove — not as a boundary other teams or services depend on.

Look elsewhere (or build in-house) when:

  • We are starting a new Laravel project. Modern Laravel (Route::apiResource, form requests, API resources, query scopes, Eloquent's own query builder) covers most of what this package does. The abstraction often costs more indirection than it saves.
  • The signal here matters: 20 stars and a low health score indicate a small user base and likely thin maintenance. For a dependency that would sit in the request path of every endpoint, that is a real risk.
  • We need active security patching, PHP 8.x / current Laravel support, or a maintainer we can escalate to. Assume no support SLA.
  • We need DDD-style repositories, multi-datasource abstractions, or non-Eloquent persistence — this package is not that.
  • The team is small and would rather not own an abstraction layer that newer hires will need to learn.

If we proceed: pin the version, wrap usage behind our own interfaces so it is replaceable, add a smoke test suite around the repository behaviors we rely on, and note it in our dependency-risk register with a review date.

How to Pitch It (Stakeholders)

To executives: This is a small, free, open-source Laravel package that gives us a consistent way to structure data access — filtering, formatting, and caching in one place. The upside is modest but real: less custom glue code and faster delivery on CRUD-heavy features. The downside is equally real: it is a niche package with a tiny user base and no maintenance guarantees, so it is a convenience, not a strategic bet. Recommendation: use it only where it clearly removes boilerplate, isolate it behind our own interfaces so we can drop it cheaply, and do not let it become architecturally load-bearing. Cost of adoption is low; cost of over-adoption is a future migration we would have to fund.

To engineering: The pattern is familiar, but the package's health is not something to rely on. Treat it as a thin helper: don't let it define your domain boundaries, don't build your test strategy around its internals, and don't extend its base classes deeply. Check framework/PHP compatibility first — that alone may rule it out. If it passes, use it for repetitive query/filter/response logic in CRUD services, keep our own interfaces at the boundary, and be prepared to replace it with framework-native features or ~a few hundred lines of our own code. If you're on a modern Laravel, argue the case for not adopting it at all — that's a legitimate and often correct position.

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.
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast