thantzin-soe/laravel-repository-generator
最新稳定版本:1.0.0
Composer 安装命令:
composer require thantzin-soe/laravel-repository-generator
包简介
Generate laravel repositories
README 文档
README
You can generate laravel repository class and interface using php artisan make:repository Category/CategoryRepository --model=Category.It will generate CategoryRepository class and CategoryRepositoryInterface inside the app/Repositories/Category folder.This package is developed based on the Spatie Laravel Package Skeleton.
Installation
You can install the package via composer:
composer require thantzin-soe/laravel-repository-generator
Usage
After installing via composer,you can generate scaffolding by running
php artisan make:repository Category/CategoryRepository --model=Category
You can add your bindings to your AppServiceProvider or you can a create a new service provider with php artisan make:provider RepositoryServiceProvider(don't forget to add it in the providers array inside of config\app.php) and add the bindings in the register() method, here is the example.
namespace App\Providers; use Illuminate\Support\ServiceProvider; use App\Repositories\Category\CategoryRepositoryInterface; use App\Repositories\Category\CategoryRepository; /** * Class RepositoryServiceProvider * @package App\Providers */ class RepositoryServiceProvider extends ServiceProvider { /** * Register services. * * @return void */ public function register() { $this->app->bind(CategoryRepositoryInterface::class, CategoryRepository::class); } }
Testing
composer test
Contributing
Any contributions are welcome.
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-07-13