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

Baserepo Laravel Package

jsdecena/baserepo

A Laravel repository-pattern package that provides reusable base repository and contract classes for cleaner CRUD, query filtering, pagination, and model interaction.

View on GitHub
Deep Wiki
Context7

Base repository

Frequently asked questions about Baserepo
What is jsdecena/baserepo and what problem does it solve?
jsdecena/baserepo is a small Laravel package that provides a base repository class and contract interface wrapping common Eloquent operations such as all, find, findBy, create, update, delete, and pagination helpers. It gives teams a consistent persistence layer between controllers or services and Eloquent models, reducing duplicated query code across models. It is framework-coupled to Laravel and Eloquent only, and the codebase is intentionally thin with no external dependencies or I/O.
How do I install jsdecena/baserepo in a Laravel application?
Installation is a composer require followed by either extending the package base repository class or applying its trait inside your own concrete repository classes. There are no published migrations, no meaningful configuration surface, and no complex service provider setup, so integration effort is usually measured in hours. The main caveat is Composer constraint resolution against modern PHP and Laravel versions rather than installation steps themselves.
Does jsdecena/baserepo support Laravel 10, Laravel 11, and PHP 8.2?
Not officially. The last release was 2019-09-26, which predates Laravel 7 and the PHP 8.x line, so its composer.json constraints will likely conflict with PHP 8.1 through 8.3 and Laravel 10 or 11. You could force resolution with ignore-platform-reqs, but that is not recommended for production. The safer path is to fork or vendor the code and validate it on your target matrix in a scratch branch.
How do I create a repository using jsdecena/baserepo?
You typically create a concrete repository class that extends the package base repository or uses its trait, then inject that repository into your controllers or service classes instead of calling Eloquent directly. The base class supplies the shared CRUD and pagination helpers so your concrete class only needs model-specific logic. Because the package is a scaffold rather than a full abstraction framework, keeping your own interfaces alongside it is a reasonable practice.
Does jsdecena/baserepo handle soft deletes, global scopes, eager loading, chunking, and transactions?
The package is a thin scaffold around naive Eloquent operations, so you should not assume it covers advanced behavior such as soft-delete awareness, global scope handling, eager loading, chunking, or transaction management out of the box. These gaps are exactly where teams get burned in production. Audit the base class before relying on it, and add explicit methods or overrides for anything your application depends on.
Is jsdecena/baserepo still maintained?
No. The project is effectively dormant: the last release was in September 2019, it sits at roughly 75 GitHub stars, and there have been no upstream compatibility or security patches. You inherit ownership of any issues, including framework drift and PHP 8 signature problems. That lifecycle risk, not code quality, is the dominant concern.
Should I composer require jsdecena/baserepo or vendor the code into my project?
Vendoring is the recommended approach. Copy the base repository into app/Repositories/BaseRepository.php or a small internal package under packages/, retain the MIT license header, and assign ownership to your platform team. This eliminates the abandoned-dependency risk entirely while preserving the ergonomics the package provides, and it lets you fix return types and deprecations for PHP 8.2 and current Eloquent contracts. Keep the Composer dependency only if a prototype confirms clean resolution on your actual stack, and treat it as transitional.
How does jsdecena/baserepo compare to Laravel actions or service classes?
Actions and service classes are the more common modern Laravel posture and avoid an extra indirection layer when you call Eloquent directly. A repository layer pays off mainly through testability and the ability to swap the persistence layer; if you never swap Eloquent, the benefit is mostly mocking convenience. Adopt jsdecena/baserepo only if your team is already committed to the repository pattern, not out of habit.
Can I use jsdecena/baserepo for query filtering and pagination?
Yes, the package advertises reusable base repository helpers for CRUD, query filtering, pagination, and model interaction, which is its main selling point. Because it is a thin wrapper, be explicit about what filtering and pagination behavior your concrete repositories need rather than assuming parity with newer Laravel features. Verify return types, since 2019-era code may return a Collection where current Eloquent would return a Builder, or vice versa.
How do I test repositories built with jsdecena/baserepo in a Laravel app?
Test your concrete repository classes against a real test database using Laravel's RefreshDatabase trait for integration coverage, and mock the repository interface in controller or service tests to keep them fast. The repository layer's main testability win is that consumers depend on an interface rather than Eloquent, so inject contracts instead of concrete classes. Run the suite on PHP 8.2 or later with deprecation warnings escalated to catch signature and return-type issues early.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections