Exemplo n.º 1
0
 /**
  * Register the Module Service Provider.
  *
  * @param string $properties
  *
  * @return string
  *
  * @throws \Nova\Module\FileMissingException
  */
 protected function registerServiceProvider($properties)
 {
     $namespace = $this->resolveNamespace($properties);
     $file = $this->repository->getPath() . DS . $namespace . DS . 'Providers' . DS . $namespace . 'ServiceProvider.php';
     $serviceProvider = $this->repository->getNamespace() . "\\{$namespace}\\Providers\\{$namespace}ServiceProvider";
     if (class_exists($serviceProvider)) {
         $this->app->register($serviceProvider);
     }
 }
Exemplo n.º 2
0
 /**
  * Register the Module Service Provider.
  *
  * @param array $properties
  *
  * @return void
  *
  * @throws \Nova\Module\FileMissingException
  */
 protected function registerServiceProvider($properties)
 {
     $namespace = $this->resolveNamespace($properties);
     $file = $this->getPath() . $namespace . DS . 'Providers' . DS . $namespace . 'ServiceProvider.php';
     // Calculate the name of Service Provider, including the namespace.
     $serviceProvider = $this->getNamespace() . "\\{$namespace}\\Providers\\{$namespace}ServiceProvider";
     if (class_exists($serviceProvider)) {
         $this->app->register($serviceProvider);
     }
 }
Exemplo n.º 3
0
 /**
  * Register the load events for the given provider.
  *
  * @param  \Nova\Foundation\Application  $app
  * @param  string  $provider
  * @param  array  $events
  * @return void
  */
 protected function registerLoadEvents(Application $app, $provider, array $events)
 {
     if (count($events) < 1) {
         return;
     }
     $app->make('events')->listen($events, function () use($app, $provider) {
         $app->register($provider);
     });
 }