Download the PHP package fomvasss/laravel-repository without Composer
On this page you can find all versions of the php package fomvasss/laravel-repository. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fomvasss/laravel-repository
More information about fomvasss/laravel-repository
Files in fomvasss/laravel-repository
Package laravel-repository
Short Description The library for build laravel repository
License MIT
Homepage https://github.com/fomvasss/laravel-repository
Informations about the package laravel-repository
Laravel repository
Base class and methods for build repository pattern in Laravel and cache queries
Installation
Run:
Publish config:
All base methods repository
- Interface all methods see in RepositoryInterface
- Realisation interface see in BaseRepository
Usage
Make own repository
Extend your repository class the next BaseRepository
class
Use repository methods
Make custom method in own repository
! Custom method do not use repository cache!
Events repository
Repository entity have next events:
RepositoryEntityCreated
RepositoryEntityUpdated
RepositoryEntityDeleted
For example, you can add in your EventServiceProvider next:
And use next method in method handle (in your listener CreatedNewModeInRepoListener
):
Usage repository cache
All cache methods see in Interface CacheableInterface
Example repository with cache:
Middleware for off cache
Example usage middleware in routes:
Add to App\Http\Kernel.php
and use in your routes:
Change log
Please see CHANGELOG for more information what has changed recently.
License
The MIT License (MIT). Please see License File for more information.