/** * Handle the command. */ public function handle(ActionExecutor $executor) { $actions = $this->builder->getTableActions(); if ($action = $actions->active()) { $executor->execute($this->builder, $action); } }
/** * Set the active action. * * @param SetActiveAction $command */ public function handle() { $prefix = $this->builder->getTableOption('prefix'); $actions = $this->builder->getTableActions(); if ($action = $actions->findBySlug(app('request')->get($prefix . 'action'))) { $action->setActive(true); } }
/** * Set the active action. * * @param $slug * @param TableBuilder $builder */ protected function setActiveAction($slug, TableBuilder $builder) { /* @var ActionInterface $action */ foreach ($builder->getTableActions() as $action) { if ($action->getSlug() === $slug) { $action->setPrefix($builder->getTableOption('prefix')); $action->setActive(true); break; } } }