sasin91 / laravel-repository
Laravel 5 - very simply repositories without all the fluff...
Requires
- illuminate/console: ~5.0
- illuminate/database: ~5.0
- illuminate/filesystem: ~5.0
- illuminate/support: ~5.0
Suggests
- league/fractal: League's well-known Fractal Transformer.
This package is auto-updated.
Last update: 2024-11-12 04:42:21 UTC
README
Simply repositories without all the fluff...
Laravel 5 Repositories is used to abstract the data layer, making our application more flexible to maintain.
Installation
Composer
Execute the following command to get the latest version of the package:
composer require sasin91/laravel-repository:@dev
Note, to pull this in you might need to set your minimum stability in composer.json optionally, prefer stable releases.
"minimum-stability":"dev", "prefer-stable": true
Laravel
In your config/app.php
add Sasin91\LaravelRepository\RepositoryServiceProvider::class
to the end of the Package Service Providers
array:
'providers' => [ ... Sasin91\LaravelRepository\RepositoryServiceProvider::class, ],
Publish Configuration
php artisan vendor:publish
Commands
To generate everything you need for your Model, run this command:
php artisan make:repository UserRepository {--generic} {--database=?} {--model=?}
if no database or model option is provided with the generic option, it'll attempt to guess a model, in your App namespace.
@note: the model option is really just an alias to the database option.