mapUsing(function ($command) { return Dispatcher::simpleMapping($command, 'CachetHQ\Cachet', 'CachetHQ\Cachet\Handlers'); }); Str::macro('canonicalize', function ($url) { return preg_replace('/([^\/])$/', '$1/', $url); }); } /** * Register the service provider. * * @return void */ public function register() { $this->registerDateFactory(); } /** * Register the date factory. * * @return void */ protected function registerDateFactory() { $this->app->singleton(DateFactory::class, function ($app) { $appTimezone = $app->config->get('app.timezone'); $cacheTimezone = $app->config->get('cachet.timezone'); return new DateFactory($appTimezone, $cacheTimezone); }); } }