Deal with the command bus in the app service provider

This commit is contained in:
Graham Campbell
2015-06-12 22:37:46 +01:00
parent c56be4c6e0
commit 50096f6a6f

View File

@@ -15,6 +15,20 @@ use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Boot the service provider.
*
* @param \Illuminate\Bus\Dispatcher $dispatcher
*
* @return void
*/
public function boot(Dispatcher $dispatcher)
{
$dispatcher->mapUsing(function ($command) {
return Dispatcher::simpleMapping($command, 'CachetHQ\Cachet\Commands', 'CachetHQ\Cachet\Handlers\Commands');
});
}
/**
* Register the service provider.
*