zhaohehe/zrepository
zhaohehe/zrepository is a Laravel repository-pattern package that wraps Eloquent queries behind clean, testable interfaces. It helps organize reusable query logic and data access so controllers and models stay lean and applications remain easier to maintain.
Consider it when:
BaseRepository than to Doctrine or Cycle.Look elsewhere when:
where()/with() on the interface, which is the worst of both worlds.chunkById, model events, soft deletes, casts. Abstractions tend to fight these.prettus/l5-repository is far more widely used, though itself aging) or, more likely, write the ~150 lines yourself so you own the surface area.To engineering leadership: This is a tactical convenience, not a strategic bet. It's a small, readable scaffold for the repository pattern in Laravel. The honest framing is "fork or vendor it, don't depend on it" — 88 stars and zero dependents means we are effectively the maintainer from day one. Recommend a one-module pilot with an explicit checkpoint: if the abstraction leaks Eloquent details or makes tests slower rather than faster, we drop it and write our own interface.
To the exec / product side: No user-facing impact; this is an internal code-structure decision. Cost is roughly a day of integration plus a small, ongoing maintenance line item. Upside is faster, more reliable tests and the option to change data sources (or split out a service) later without a rewrite. Downside is a low-visibility dependency we'd need to own.
Recommended position: Pilot, pin the version, fork into our org if the pilot succeeds, and revisit at the end of the sprint. Frame the decision as "do we invest in a data-access seam?" — the package is just the cheapest way to test that question, not a commitment to the vendor.
How can I help you explore Laravel packages today?