sasin91/laravel-repository

Laravel 5 - very simply repositories without all the fluff...

dev-master 2017-01-19 20:24 UTC

This package is auto-updated.

Last update: 2020-05-11 18:35:23 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.