/** * Register any application services. * * @return void */ public function register() { parent::register(); $this->app->singleton(['server' => Contracts\Factory::class], function ($app) { return new Server\Factory($app, storage_path('server')); }); }
/** * Register the service provider. * * @return void */ public function register() { parent::register(); $directory = $this->directory(); foreach ($this->publish as $group => $paths) { $locations = []; array_walk($paths, function ($to, $from) use($directory, &$locations) { $from = sprintf("%s/%s", $directory, $from); $locations[$from] = base_path($to); }); $this->publishes($locations, $group); } }
/** * Register any application services. * * @return void */ public function register() { parent::register(); $theme = $this->app->register(config('pandaac.pandaac.theme')); if (!$theme instanceof ThemeServiceProvider) { throw new Exception('Theme Service Provider must extend \\Apolune\\Core\\ThemeServiceProvider.'); } if (!property_exists($theme, 'namespace')) { throw new Exception('Theme Service Provider must declare a namespace property.'); } if (!preg_match('/^\\b([a-z-]+)\\b\\/\\b([a-z-]+)\\b$/i', $theme->getNamespace())) { throw new Exception('Theme Service Provider namespace must follow the vendor/package convention (e.g. pandaac/theme-tibia).'); } if (config('app.debug') and config('app.debugbar') and class_exists($debugbar = Debugbar::class)) { $this->app->register($debugbar); } $this->app->instance('theme.namespace', $theme->getNamespace()); }
/** * Register any application services. * * @return void */ public function register() { $this->app['seed.handler']->register(\Perilune\Resources\Seeds\DatabaseSeeder::class); parent::register(); }