承接 detatech/repository-pattern 相关项目开发

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

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

detatech/repository-pattern

Composer 安装命令:

composer require detatech/repository-pattern

包简介

Repository Pattern For Laravel >= 5.1.* | >= 5.2.* | >= 5.3.*

README 文档

README

Create Repository Pattern Files with a single command.

Usage

  • Require this package using composer
composer require detatech/repository-pattern:1.0.*
  • Update the $providers array in config/app.php
$providers = [
    // ... other serivce providers

    DetaTech\RepositoryPattern\RepositoryPatternServiceProvider::class,
];
  • Publish the default configuration (optional)
$ php artisan vendor:publish

You can now view the command repository:create has been listed in the artisan list. Checkout using

$ php artisan list

Once you create the file, you have to bind it to the IoC container of the application. For that, open providers/AppServiceProvider and inside the register method, paste the following code:

$repositoryFileNames = [
    // Whatever file name that you give while creating the file from
    // the terminal that same name should come here in single quotes(')
];

foreach ($repositoryFileNames as $key => $fileName) {
    // Notice the namespace..
    // Keep it default if you have not changed it,
    // Else, update the word _App_ with your application's namespace.

    $this->app->bind(
        "App\\Repositories\\Contracts\\{$fileName}Contract", "App\\Repositories\\Classes\\{$fileName}"
    );
}

Failing to do the above point will give Exception:

Target [/path/to/Contract/File] is not instantiable

Done.

LICENSE

This package is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-08-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固