21/07
2015
dev-master
9999999-dev
The Requires
- php >=5.4.0
- illuminate/support 4.2.*
- laravel/laravel 4.2.*
by Nick Chikovani
Wallogit.com
2017 © Pedro Peláez
Repositories and Gateways are cool, but we are sometimes too lazy to set them up., (*1)
This package solves the problem, it handles automatic initialization and creating new Repositories & Gateways for you!, (*2)
Install with composer, (*3)
"nch7/laravel-repository-gateway-maker" : "dev-master"
Add package service provider to app.php, (*4)
Nch7\LaravelRepositoryGatewayMaker\LaravelRepositoryGatewayMakerServiceProvider
Add psr-4 autoloading, (*5)
"psr-4" : {
"acme\\": "app/acme/"
}
Initialize, (*6)
php artisan repogate:init
Add repository service provider to app.php, (*7)
acme\Repositories\RepositoryServiceProvider
Create Gateway and Repository for specific model, (*8)
php artisan repogate:make User
<?php
use acme\Gateways\UserGateway;
class UsersController extends BaseController {
public function __construct(UserGateway $users) {
$this->users = $users;
}
public function index()
{
return $this->users->all();
}
}