New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

seguce92/laravel-repos

Simple repository and Controller package for Laravel 5.
140
Install
composer require seguce92/laravel-repos
Latest Version:v1.3.1
PHP:>=5.6.0
Laravel:5
License:MIT
Last Updated:Jun 25, 2019
Links: GitHub  ·  Packagist
Maintainer: seguce92

Installation

Install LaravelRepos as you would with any other dependency managed by Composer:

$ composer require seguce92/laravel-repos

Configuration

After installing repo all you need is to register the Seguce92\LaravelRepos\ServiceProvider in your config/app.php configuration file:

'providers' => [
    // Other service providers...

    Seguce92\LaravelRepos\ServiceProvider::class,
],

Creating a repository class

Use the seguce92:repos command to create your repository classes. This command will take as argument the repository class namesapce (from App) and a --model option which allows you to specify the full namespace of the Eloquent model to which the repository will be tied.

$ php artisan seguce92:repos "Repositories\FooRepository" --class="Foo" --model="App\Models\Foo"

OR

$ php artisan seguce92:repos "Repositories\FooRepository" -c "Foo" -m "App\Models\Foo"

The above command will generate the following repository class in the app/Repositories directory:

--hashid This option use if used hashid

Creating a controller class

Use the seguce92:cont command to create your repository classes. This command will take as argument the repository class namesapce (from App) and a --model option which allows you to specify the full namespace of the Eloquent model to which the repository will be tied.

$ php artisan seguce92:cont "Http\Controllers\FooController" --repository="App\Repositories\FooRepository" --model="foo"

OR

$ php artisan seguce92:cont "Http\Controllers\FooController" -r "App\Repositories\FooRepository" -m "foo"

The above command will generate the following repository class in the app/Http/Controllers directory:

Related Packages

miroc/laravel-adminer

Adminer (by Jakub Vrana) wrapper for Laravel 5

92,163 58
lerouse/laravel-repository

Repository implementation for Laravel.

19,760 5
eilander/repository

Flexible Laravel 5 repository package.

150 0
skydiver/laravel-adminer

Adminer (by Jakub Vrana) wrapper for Laravel 5

57 0
imperat0r/laravel-adminer

Adminer (by Jakub Vrana) wrapper for Laravel 5

13 0

Version History

Version Released PHP Laravel License
v1.3.1 >=5.6.0 ~5.0 MIT
v1.3 >=5.6.0 ~5.0 MIT
v1.2.10 >=5.6.0 ~5.0 MIT
v1.2.9 >=5.6.0 ~5.0 MIT
v1.2.8 >=5.6.0 ~5.0 MIT