PHPackages                             veeenex/command-center - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. veeenex/command-center

ActiveLibrary[CLI &amp; Console](/categories/cli)

veeenex/command-center
======================

Commands and domain events for Laravel framework

316PHP

Since Nov 18Pushed 9y agoCompare

[ Source](https://github.com/VeeeneX/command-center)[ Packagist](https://packagist.org/packages/veeenex/command-center)[ RSS](/packages/veeenex-command-center/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

VeeeneX / CommandCenter
=======================

[](#veeenex--commandcenter)

**Package is forked from [airbornfoxx/commandcenter](https://github.com/airbornfoxx/commandcenter/blob/master/readme.md)**

This package provides a framework agnostic architecture for utilizing commands and domain events in your applications. Any of the components can be easily extended for your specific use.

*inspired and expanded on [Jeffrey Way](https://github.com/JeffreyWay) at [Laracasts](https://github.com/Laracasts)*

Installation
------------

[](#installation)

Install CommandCenter through Composer.

### Add to composer.json

[](#add-to-composerjson)

```
"require": {
    "veeenex/command-center": "~1.0"
}
```

### Install

[](#install)

```
composer require "veeenex/command-center"

```

### Laravel

[](#laravel)

Update application config to include the package's service provider.

```
'VeeeneX\CommandCenter\Provider\CommandCenterServiceProvider'
```

**Check out the Laravel section at the end of this document for additional features!**

Usage
-----

[](#usage)

Before getting started, this approach is not recommended for smaller projects where architecture isn't as important. This package helps to structure your business logic, stick to the single responsibility principle, and keep your controllers skinny.

### CommandApplication

[](#commandapplication)

In order to get started, you must register your specific application with CommandCenter by implementing the package's `CommandApplication` interface and registering any bindings. Please use the included Laravel implementation and service provider for reference in other frameworks. The reference classes are below:

- Flyingfoxx\\CommandCenter\\Laravel\\Application
- Flyingfoxx\\CommandCenter\\Laravel\\CommandCenterServiceProvider

### Command

[](#command)

It all starts with a command. A command is an "instruction" you give to your domain to carry out specific actions. It is represented as a simple DTO (data transfer object) that carries the data needed to perform that specific command.

For example, say you need to register a new user. You would then create a `RegisterUserCommand` that would look like this:

```
