定制 xtrasmal/tactician-provider 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

xtrasmal/tactician-provider

Composer 安装命令:

composer require xtrasmal/tactician-provider

包简介

Laravel ServiceProvider for the Tactician CommandBus library

README 文档

README

Laravel Build Status Scrutinizer Code Quality

Laravel ServiceProvider for the Tactician library https://github.com/thephpleague/tactician/

If you are looking for a Symfony2 Bundle or want to help: https://github.com/xtrasmal/TacticianBundle

Setup

First add this provider to your composer dependencies:

> composer require xtrasmal\tactician-provider

Then register it in your config/app.php.

	'providers' => [
		'Xtrasmal\TacticianProvider\TacticianServiceProvider',
            // ...

That's it!

Configuring Command Handlers

The most common use case with Tactician is passing a Command to the Command Bus and having it routed to the Command Bus.

Since handlers often have extra dependencies and are best lazily-loaded, you'll want to register them in the IoC container.

Let's say we have two classes, RegisterUserCommand and RegisterUserHandler. Add the following to config/tactician.php

return [

    'buses' => [

        'default' => [

            'commandbus' => 'League\Tactician\CommandBus',

            'middleware' => [
                // ...
            ],

            'commmands' => [

                'RegisterUser' => [
                    'command' => 'Namespace\RegisterUserCommand',
                    'handler' => 'Namespace\RegisterUserHandler'
                ],
                'RemoveUser' => [
                    'command' => 'Namespace\RemoveUserCommand',
                    'handler' => 'Namespace\RemoveUserHandler'
                ],                
                
                // ...

            ],

        ],

    ],
];

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-04-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固