Download the PHP package mawuekom/laravel-repository-layer without Composer
On this page you can find all versions of the php package mawuekom/laravel-repository-layer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mawuekom/laravel-repository-layer
More information about mawuekom/laravel-repository-layer
Files in mawuekom/laravel-repository-layer
Package laravel-repository-layer
Short Description Repository Pattern implementation for Laravel
License MIT
Homepage https://github.com/mawuva/laravel-repository-layer
Informations about the package laravel-repository-layer
Repository Pattern implementation for Laravel
This package is a Simple Repository Pattern implementation for Laravel Projects and an easily way to build Eloquent queries from API requests
Installation
You can install the package via composer:
Laravel
After register the service provider to the providers
array in config/app.php
Publish package config
Lumen
Go to bootstrap/app.php
, and add this in the specified key
Then, create config
folder in your root directory
Once done, create query-builder.php
in the config folder and add this config in it
Create also json-api-paginate.php
in the config folder and add this config in it
Once done all of this, go back to bootstrap/app.php
, and add the config files you created
This config allows you to filter, sort and include eloquent relations based on API requests.
It also allows to paginate and display data with the JSON API spec.
It using :
-
Laravel-query-builder to build queries
-
laravel-json-api-paginate that plays nice with the JSON API spec
Check on this links for more informations
Usage
This package has two repositories classes :
BaseRepository
which implements common methods for eloquent modelBaseApiRepository
that extends fromBaseRepository
and implements additional methods to build Eloquent queries from API requests
Using BaseRepository
Your repository will look like this
Your repository class should extends from Mawuekom\RepositoryLayer\BaseRepository
class which implements the interface Mawuekom\RepositoryLayer\Contracts\BaseRepositoryContract
that has the following methods :
Using BaseApiRepository
Your repository will look like this
Your repository class should extends from Mawuekom\RepositoryLayer\BaseApiRepository
class which extends Mawuekom\RepositoryLayer\BaseRepository
and implements the interface Mawuekom\RepositoryLayer\Contracts\BaseApiRepositoryContract
that has the following methods :
Hope this package will help you build awesome things
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-repository-layer with dependencies
illuminate/support Version ^8.0
illuminate/database Version ^8.0
mawuekom/laravel-searchable Version ^1.1
spatie/laravel-json-api-paginate Version ^1.10
spatie/laravel-query-builder Version ^3.5