jooservices / laravel-repository
Base repositories with CRUD, filtering, ordering and query-from-request for Laravel
Requires
- php: ^8.5
- illuminate/contracts: ^12.0
- illuminate/database: ^12.0
- illuminate/http: ^12.0
- illuminate/support: ^12.0
Requires (Dev)
- laravel/pint: ^1.0
- orchestra/testbench: ^10.0
- phpmd/phpmd: ^2.0
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11.0
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2026-04-07 07:19:44 UTC
README
The JOOservices Laravel Repository package is a PHP 8.5+ Laravel package for trait-based repository composition, CRUD support, filter and order pipelines, and request-driven query assembly.
Package name: jooservices/laravel-repository
Install
composer require jooservices/laravel-repository
Optionally publish the package config:
php artisan vendor:publish --tag=laravel-repository-config
Quick example
use App\Models\User; use Jooservices\LaravelRepository\Contracts\RepositoryInterface; use Jooservices\LaravelRepository\Repositories\EloquentRepository; use Jooservices\LaravelRepository\Traits\HasCrud; use Jooservices\LaravelRepository\Traits\HasFilter; use Jooservices\LaravelRepository\Traits\HasOrder; final class UserRepository extends EloquentRepository implements RepositoryInterface { use HasCrud; use HasFilter; use HasOrder; public function __construct(User $model) { parent::__construct($model); } } $repository = app(UserRepository::class); $user = $repository->find($id); $users = $repository->filter(['status' => 'active'])->orderBy(['created_at' => 'desc'])->paginate(15);
What is supported today
- trait-based repository composition through segregated contracts and traits
- CRUD operations through
HasCrud - filter chains, collection retrieval, and pagination through
HasFilter - ordering through
HasOrder - request-driven query parsing through
HasRequestQuery - reusable
FilterandOrdervalue objects
Important current boundaries
- repositories opt into behavior through traits; no feature is globally implied
- query state is lazily created and reset after terminal filter operations
RequestQueryParsersupports only the implemented clause families
Documentation
Start with:
- Documentation Hub
- Installation
- Quick Start
- Trait-Based Composition
- Competitive Comparison And Roadmap
- Risks, Legacy, and Gaps
AI Support
This repository includes an AI skill pack for agents working in Cursor, Claude Code, VS Code, JetBrains, and Antigravity.
Start with:
The canonical skill source lives in .github/skills/, with adapter layers for each supported AI environment.
Development
composer lint:all
composer test
Contributor workflow details live in:
GitHub Actions and Services
The repository workflow set is designed to include CI, release, PR labeler, semantic PR title, scorecard, and secret-scanning workflows.
The CI baseline covers security checks, linting, tests with coverage artifacts, and optional dependency review. Release is tag-driven through vX.Y.Z tags.
Current external service integrations:
Codecovfor CI coverage uploads whenCODECOV_TOKENis configuredPackagistfor release-time package update notifications
Changelog
See CHANGELOG.md for version history.
License
This project is licensed under the MIT License.