mohamadtsn / laravel-repository
repository class management in laravel apps
2.3.0
2024-07-07 17:10 UTC
Requires
- php: ^8.0|^8.1|^8.2
- illuminate/console: ^7.0|^8.0|^9.0|^10.0|^11.0
- illuminate/container: ^7.0|^8.0|^9.0|^10.0|^11.0
- illuminate/contracts: ^7.0|^8.0|^9.0|^10.0|^11.0
- illuminate/support: ^7.0|^8.0|^9.0|^10.0|^11.0
README
Laravel Repository
Use Repository Pattern in Laravel app
Installation: ⬇️
composer require mohamadtsn/laravel-repository
configuration: ⚙️
Publish config file
php artisan vendor:publish --tag=repository-config --force
Do in Laravel 8:
Put this in App\Http\Controllers\Controller.php
use Mohamadtsn\Repository\Traits\Repository; // use Repository trait class Controller extends BaseController { use AuthorizesRequests, DispatchesJobs, ValidatesRequests, Repository// use trait in Controller class; // other class methods }
Enjoy it 👋