Package Data | |
---|---|
Maintainer Username: | faiverson |
Maintainer Contact: | fa.iverson@gmail.com (Fabian Torres) |
Package Create Date: | 2017-06-01 |
Package Last Update: | 2019-02-20 |
Language: | PHP |
License: | Apache-2.0 |
Last Refreshed: | 2025-02-06 03:05:22 |
Package Statistics | |
---|---|
Total Downloads: | 435 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 3 |
Total Watchers: | 1 |
Total Forks: | 1 |
Total Open Issues: | 0 |
This package is a layer to interact between Controller and Model. If you want to create an abstraction layer to centralize all the queries in one class, instead of being adding models (eloquent queries) in a controller. What about to repeat that code in a command or observer or any other peace of the puzzle. This is where Gateways are handy! You only need to inject the Gateway dependency whereever you want.
composer require faiverson/gateway-pattern
php artisan vendor:publish
Done!
Go to the console and you can run:
make:gateways:controller Create a new controller class make:gateways:full Create a new Repository class make:gateways:gateway Create a new Gateway class make:gateways:interface Create a new Interface class make:gateways:model Create a new Eloquent model class make:gateways:repository Create a new Repository class
-Copy the line generated in your console into app/Providers/RepositoryServiceProvider.php
e.g. $this->app->bind('App\Repositories\Interfaces\FooInterface', 'App\Repositories\FooRepository');
create your route
This package is open-sourced software licensed under the Apache license.