/** * Boot the service provider. * * @param \AltThree\Bus\Dispatcher $dispatcher */ public function boot(Dispatcher $dispatcher) { $dispatcher->mapUsing(function ($command) { return Dispatcher::simpleMapping($command, 'CachetHQ\\Cachet', 'CachetHQ\\Cachet\\Handlers'); }); Str::macro('canonicalize', function ($url) { return preg_replace('/([^\\/])$/', '$1/', $url); }); }
/** * Boot the service provider. * * @param \AltThree\Bus\Dispatcher $dispatcher */ public function boot(Dispatcher $dispatcher) { $dispatcher->mapUsing(function ($command) { return Dispatcher::simpleMapping($command, 'CachetHQ\\Cachet\\Bus', 'CachetHQ\\Cachet\\Bus\\Handlers'); }); $dispatcher->pipeThrough([UseDatabaseTransactions::class]); Str::macro('canonicalize', function ($url) { return preg_replace('/([^\\/])$/', '$1/', $url); }); }
/** * Register command-to-handler mappings. * * @param array $commands * * @return void */ public function maps(array $commands) { $this->dispatcher->maps($commands); }