This is a package to easely integrate a repository pattern with the needed service provider and all the necessary basic functions
Require this package with composer. It is recommended to only require the package for development.
composer require wekode/repositoryLaravel uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.
If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php
Wekode\Repository\RepositorySetupServiceProvider,php artisan vendor:publish --provider="Wekode\Repository\RepositorySetupServiceProvider"This package comes with a command that creates the repositories and contracts, as well as the model if it does not exist.
php artisan make:repository PostThis command will create a repository file, a contract file and links the in the RespositoryServiceProvider. PS: the used model will be the first word of the Repository file name (ex : PostRepository will be linked to the model Post)
In case the model does not exist you can use this command
php artisan make:repository Post -mThis command will create the repository as well as execute a model creation command
php artisan make:model Post -aOr if you do not want to create everything you can specify the option.
php artisan make:repository PostRepository -m -s -f -r