Download the PHP package nathanbarrett/laravel-repositories without Composer
On this page you can find all versions of the php package nathanbarrett/laravel-repositories. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nathanbarrett/laravel-repositories
More information about nathanbarrett/laravel-repositories
Files in nathanbarrett/laravel-repositories
Package laravel-repositories
Short Description Repository service layer for Laravel apps
License MIT
Homepage https://github.com/nathanbarrett/laravel-repositories
Informations about the package laravel-repositories
Repository service layer for Laravel apps
Repositories are meant to act as a middle layer between Models and higher level objectives like services. They are meant to abstract the data layer and provide a clean API for data access. Use a repository when the action is mostly or entirely about the related model.
Layers of a Laravel application using Repositories
- Service - Highest level of abstraction. Uses Repositories and Models to perform actions. Example:
StripePaymentService
- Repository - Middle layer of abstraction. Uses Models (not just the related Model) to perform actions. Example:
UserRepository
- Model - Lowest level of abstraction. Represents a single table in the database. Use only for relations and light transforms of the data. Example:
User
Installation
You can install the package via composer:
Usage
First create a repository class
Generics are used to ensure that your IDE can provide code completion and type hinting.
Or you can quickly create one using the command
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-repositories with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0