/**
  * Detect the active module and setup our
  * environment with it.
  */
 public function handle()
 {
     /**
      * In order to detect we MUST have a route
      * and we MUST have a namespace in the
      * streams::addon action parameter.
      *
      * @var Route $route
      */
     $route = $this->request->route();
     /* @var Module $module */
     if ($route && ($module = $this->modules->get(array_get($route->getAction(), 'streams::addon')))) {
         $module->setActive(true);
     }
     if (!$module && $this->request->segment(1) == 'admin' && ($module = $this->modules->findBySlug($this->request->segment(2)))) {
         $module->setActive(true);
     }
     if (!$module) {
         return;
     }
     $this->container->make('view')->addNamespace('module', $module->getPath('resources/views'));
     $this->container->make('translator')->addNamespace('module', $module->getPath('resources/lang'));
     $this->asset->addPath('module', $module->getPath('resources'));
     $this->image->addPath('module', $module->getPath('resources'));
 }
 /**
  * Handle the command.
  */
 public function handle(Image $image, Container $container, Application $application)
 {
     $image->addPath('public', base_path('public'));
     $image->addPath('node', base_path('node_modules'));
     $image->addPath('asset', $application->getAssetsPath());
     $image->addPath('streams', $container->make('streams.path') . '/resources');
     $image->addPath('bower', $container->make('path.base') . '/bin/bower_components');
 }
 /**
  * Detect the active theme and set up
  * our environment with it.
  */
 public function handle()
 {
     $admin = $this->themes->get($this->config->get('streams::themes.admin'));
     $standard = $this->themes->get($this->config->get('streams::themes.standard'));
     if ($admin) {
         $admin->setActive(true);
     }
     if ($standard) {
         $standard->setActive(true);
     }
     if ($admin && in_array($this->request->segment(1), ['installer', 'admin'])) {
         $admin->setCurrent(true);
     } elseif ($standard) {
         $standard->setCurrent(true);
     }
     if ($theme = $this->themes->current()) {
         $this->view->addNamespace('theme', $theme->getPath('resources/views'));
         $this->translator->addNamespace('theme', $theme->getPath('resources/lang'));
         $this->asset->addPath('theme', $theme->getPath('resources'));
         $this->image->addPath('theme', $theme->getPath('resources'));
     }
 }