PHPackages                             arobs/laravelmodules - 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. [Framework](/categories/framework)
4. /
5. arobs/laravelmodules

ActiveLibrary[Framework](/categories/framework)

arobs/laravelmodules
====================

Laravel 5 Modules

153PHP

Since Nov 26Pushed 11y ago7 watchersCompare

[ Source](https://github.com/AROBS/laravel-modules)[ Packagist](https://packagist.org/packages/arobs/laravelmodules)[ RSS](/packages/arobs-laravelmodules/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

laravel-modules
===============

[](#laravel-modules)

A Laravel 5 package for modullarity that contains Caffeinated Modules and Laracasts Commander packages

Caffeinated Modules
===================

[](#caffeinated-modules)

[![Build Status](https://camo.githubusercontent.com/556a6e56b623ffe22692b0f8bb4f809f823851fff0f7bfb61f07c54b72f799da/68747470733a2f2f7472617669732d63692e6f72672f6361666665696e617465642f6d6f64756c65732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/caffeinated/modules)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/ac29736f92ef57ecd3fd5812be30ed27f8ca4ce54363747bbca66fccf9b0a812/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6361666665696e617465642f6d6f64756c65732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/caffeinated/modules/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/cf695f674305c0b648857ec658533f0952fe1e76c56c492df8e33290946cb121/68747470733a2f2f706f7365722e707567782e6f72672f6361666665696e617465642f6d6f64756c65732f762f737461626c652e737667)](https://packagist.org/packages/caffeinated/modules)[![Total Downloads](https://camo.githubusercontent.com/346a93ed5ea48af9535d843be7855d48058c0140aa29edef27907fb04ce0f1f7/68747470733a2f2f706f7365722e707567782e6f72672f6361666665696e617465642f6d6f64756c65732f646f776e6c6f6164732e737667)](https://packagist.org/packages/caffeinated/modules)[![Latest Unstable Version](https://camo.githubusercontent.com/6f9dfd164ad5b4b31c286ac1526f236d2d9163c1726ecfc0105732e74e8ac006/68747470733a2f2f706f7365722e707567782e6f72672f6361666665696e617465642f6d6f64756c65732f762f756e737461626c652e737667)](https://packagist.org/packages/caffeinated/modules)[![License](https://camo.githubusercontent.com/8db058c56998549a12e09980dbf2a651736dcda95de77fc2fd1d07f847cf700d/68747470733a2f2f706f7365722e707567782e6f72672f6361666665696e617465642f6d6f64756c65732f6c6963656e73652e737667)](https://packagist.org/packages/caffeinated/modules)

All features for the initial release as outlined within the [roadmap](https://github.com/caffeinated/modules/wiki/Roadmap#10-beta) have been completed. I'm simply waiting until Laravel 5.0 is officially released to tag this as stable v1.0. In the meantime I will continue to clean up the code that currently stands.

---

To learn more about the usage of this package, please refer to the full set of [documentation](https://github.com/caffeinated/modules/wiki). You will find quick installation instructions below.

---

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

[](#installation)

Begin by installing the package through Composer. The best way to do this is through your terminal via Composer itself:

```
composer require caffeinated/modules

```

Once this operation is complete, simply add both the service provider and facade classes to your project's `config/app.php` file:

#### Service Provider

[](#service-provider)

```
'Caffeinated\Modules\ModulesServiceProvider'

```

#### Facade

[](#facade)

```
'Module' => 'Caffeinated\Modules\Facades\Module'

```

#### New Artisan Command

[](#new-artisan-command)

```
php artisan module:controller ModuleName ControllerName

```

And that's it! With your coffee in reach, start building out some awesome modules!

Laravel Commander
=================

[](#laravel-commander)

This package gives you an easy way to leverage commands and domain events in your Laravel projects.

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

[](#installation-1)

Per usual, install Commander through Composer.

```
"require": {
    "laracasts/commander": "~1.0"
}
```

Next, update `app/config/app.php` to include a reference to this package's service provider in the providers array.

```
'providers' => [
    'Laracasts\Commander\CommanderServiceProvider'
]
```

Usage
-----

[](#usage)

Easily, the most important piece of advice I can offer is to keep in mind that this approach isn't for everything. If you're building a simple CRUD app that does not have much business logic, then you likely don't need this. Still want to move ahead? Okay - onward!

### The Goal

[](#the-goal)

Imagine that you're building an app for advertising job listings. Now, when an employer posts a new job listing, a number of things need to happen, right? Well, don't put all that stuff into your controller! Instead, let's leverage commands, handlers, and domain events to clean up our code.

### The Controller

[](#the-controller)

To begin, we can inject this package's `CommanderTrait` into your controller (or a BaseController, if you wish). This will give you a couple helper methods to manage the process of passing commands to the command bus.

```
