Ejemplo n.º 1
0
 /**
  * Handle the command.
  *
  * @return \Anomaly\NavigationModule\Link\LinkCollection|mixed|null
  */
 public function handle()
 {
     if (!$this->menu) {
         $this->menu = $this->dispatch(new GetMenu($this->options->get('menu')));
     }
     if ($this->menu) {
         $links = $this->menu->getLinks();
     } else {
         $links = $this->options->get('links');
     }
     if (!$links) {
         return null;
     }
     if ($root = $this->options->get('root')) {
         if ($link = $this->dispatch(new GetParentLink($root, $links))) {
             $this->options->put('parent', $link);
         }
     }
     // Remove restricted for security purposes.
     $this->dispatch(new RemoveRestrictedLinks($links));
     // Set the relationships manually.
     $this->dispatch(new SetParentRelations($links));
     $this->dispatch(new SetChildrenRelations($links));
     // Flag appropriate links.
     $this->dispatch(new SetCurrentLink($links));
     $this->dispatch(new SetActiveLinks($links));
     return $links;
 }
Ejemplo n.º 2
0
 /**
  * Handle the command.
  */
 public function handle()
 {
     $this->data->put('ADMIN_USERNAME', $this->command->ask('Enter the desired username for the admin user', env('ADMIN_USERNAME', 'admin')));
     $this->data->put('ADMIN_EMAIL', $this->command->ask('Enter the desired email for the admin user', env('ADMIN_EMAIL')));
     // Validate email.
     if (!filter_var($this->data->get('ADMIN_EMAIL'), FILTER_VALIDATE_EMAIL)) {
         $this->command->error('You must provide a valid email for the admin.');
         exit;
     }
     $this->data->put('ADMIN_PASSWORD', $this->command->ask('Enter the desired password for the admin user', env('ADMIN_PASSWORD')));
 }
Ejemplo n.º 3
0
 /**
  * Get a value from the value collection.
  *
  * @param      $key
  * @param null $default
  * @return mixed
  */
 public function getValue($key, $default = null)
 {
     return $this->values->get($key, $default);
 }
 /**
  * Return a config value.
  *
  * @param      $key
  * @param null $default
  * @return mixed
  */
 public function config($key, $default = null)
 {
     return $this->config->get($key, $default);
 }
 /**
  * Handle the command.
  *
  * @param Factory $view
  * @return null|string
  */
 public function handle(Factory $view)
 {
     $menu = $this->dispatch(new GetMenu($this->options->get('menu')));
     $links = $this->dispatch(new GetLinks($this->options, $menu));
     return $view->make($this->options->get('view', 'anomaly.module.navigation::links'), ['menu' => $menu, 'links' => $links, 'options' => $this->options])->render();
 }
Ejemplo n.º 6
0
 /**
  * Get an option value.
  *
  * @param      $key
  * @param null $default
  * @return mixed
  */
 public function getOption($key, $default = null)
 {
     return $this->options->get($key, $default);
 }