承接 ritenn/implementator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ritenn/implementator

Composer 安装命令:

composer require ritenn/implementator

包简介

Binding automatically interfaces to implementation and also helps creating custom class files e.g. Service or Repository.

README 文档

README

This package adds additional 3 artisan commands that will speed up your development. You can quickly create contract/interface and implement it to your service or repository layer just like with any other artisan commands e.g. make:model etc. Additionally, it automatically binds interface to implementation by base file name, which means that you don't have to waste time to do it manually.

Make your code clean and readable!

Installation

Requires PHP >=7.0 and Laravel 7.x

composer require ritenn/implementator

Publishing config

That will copy 'implementator' config to your app config directory

php artisan vendor:publish --provider="Ritenn\Implementator\ImplementatorServiceProvider" --force

Available commands and options

  • php artisan make:service *baseName - creates contract and implementation for your service layer
  • php artisan make:repository *baseName - creates contract and implementation for your repository
  • You can also use option --without-contract, if you want to create just layer without contract implementation
  • Finally, you can create contract without implementation using php artisan make:contract *baseName. However, if contracts categorization is enabled in your config you must also specify layer name e.g. --layer=Services

*baseName - e.g. TestService, base name is 'Test', UserRepository > User, CartContract > Cart

Configuration

  1. You can change it to 'Interfaces' if you wish, that will affect folders/files/class names
    'terminology' => 'Contracts'
  2. If enabled, commands will create additional subfolders for your contracts
    'contracts_categories' => true
  3. If enabled, bindings will be loaded from cache in production
    'cache' => true
  4. You can add exceptions for auto-bindings, if your class requires additional parameters that won't be auto resolved by laravel.
    'binding_exceptions' => array()
    e.g.
    binding_exceptions' => array(['App\Contracts\Services\TestContract' => 'App\Services\TestService'], [... => ...], ...)

统计信息

  • 总下载量: 105
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固