aleksandro_del_piero / repository
Package for creating repository files for Laravel
1.0.0
2023-12-09 03:37 UTC
Requires (Dev)
- orchestra/testbench: ^8.0
- phpunit/phpunit: ^10.3
This package is auto-updated.
Last update: 2024-09-09 18:08:30 UTC
README
This is a simple package for generating repository files in Laravel
Installation
You can install the package via composer:
composer require aleksandro_del_piero/repository
Publish configuration file (required)*!. If you do not publish the configuration file, the files will be created in the directory App/.
php artisan vendor:publish --provider=AleksandroDelPiero\Repository\RepositoryServiceProvider
Documentation
// Create new repository for model User php artisan make:repository UserRepository --model=User // Or create new repository for model User php artisan make:repository UserRepository After this you will need to specify the model name: Specify the name of the model: > User
By default, all files will be created along the path App/Repositories. But this can be changed in the configuration file config/repositories.php.
return [ 'namespace' => '\\Repositories' ];
As an example, you can change the directory to Libs/Repsitories
return [ 'namespace' => '\\Libs\\Repositories' ];
After changing the configuration file, it is advisable to run the command to clear the cache:
php artisan optimize:clear
License
The MIT License (MIT). Please see License File for more information.