2017 © Pedro Peláez
 

library tactician-provider

Laravel ServiceProvider for the Tactician CommandBus library

image

xtrasmal/tactician-provider

Laravel ServiceProvider for the Tactician CommandBus library

  • Sunday, April 5, 2015
  • by netbulae
  • Repository
  • 3 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

TacticianProvider

Laravel Build Status Scrutinizer Code Quality, (*1)

Laravel ServiceProvider for the Tactician library https://github.com/thephpleague/tactician/, (*2)

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

Setup

First add this provider to your composer dependencies:, (*4)

> composer require xtrasmal\tactician-provider, (*5)

Then register it in your config/app.php., (*6)

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

That's it!, (*7)

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., (*8)

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

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


return [ 'buses' => [ 'default' => [ 'commandbus' => 'League\Tactician\CommandBus', 'middleware' => [ // ... ], 'commmands' => [ 'RegisterUser' => [ 'command' => 'Namespace\RegisterUserCommand', 'handler' => 'Namespace\RegisterUserHandler' ], 'RemoveUser' => [ 'command' => 'Namespace\RemoveUserCommand', 'handler' => 'Namespace\RemoveUserHandler' ], // ... ], ], ], ];

The Versions

05/04 2015

dev-master

9999999-dev

Laravel ServiceProvider for the Tactician CommandBus library

  Sources   Download

The Requires

 

by Xander Smalbil

laravel commandbus tactician