Add dependable action in datatable context menu

@param array $actions
@param \Illuminate\Database\Eloquent\Model $row
@param Closure $element
@return boolean
330001
protected function resolveDatatableAction($actions, $row, $element)
    {
        if (!$element instanceof Closure) {
            return false;
        }
        $action = call_user_func($element, $row);
        if (empty($action)) {
            return false;
        }
        $url   = handles(array_get($action, 'url', '#'));
        $title = array_get($action, 'title');
        $link  = app('html')->link($url, $title, array_get($action, 'attributes', []));
        ($actions instanceof Collection) ? $actions->push($link) : array_push($actions, $link);
        return $actions;
    }
17409
public function addRoute($methods, $uri, $action)
    {
        if (\is_string($action)) {
            $action = ['uses' => $action, 'controller' => $action];
        } elseif ($action instanceof Closure) {
            $action = [$action];
        }

        $action = $this->mergeLastGroupAttributes($action);

        $action = $this->addControllerMiddlewareToRouteAction($action);

        $uri = $uri === '/' ? $uri : '/'.\trim($uri, '/');

        if (! empty($action['prefix'])) {
            $uri = '/'.\ltrim(\rtrim(\trim($action['prefix'], '/').'/'.\trim($uri, '/'), '/'), '/');

            unset($action['prefix']);
        }

        $action['uri'] = $uri;

        return $this->adapter->addRoute((array) $methods, $action['version'], $uri, $action);
    }
1150697
public function useRenderer($row = null)
	{
		$renderer = $this->getRenderer();

		if ($row instanceof Row) {
			$args = [$row->getItem()];
		} else {
			$args = [];
		}

		if (!$renderer) {
			throw new DataGridColumnRendererException;
		}

		if ($renderer->getConditionCallback()) {
			if (!call_user_func_array($renderer->getConditionCallback(), $args)) {
				throw new DataGridColumnRendererException;
			}

			return call_user_func_array($renderer->getCallback(), $args);
		}

		return call_user_func_array($renderer->getCallback(), $args);
	}
190941
protected function eventableAction(
        /*# string */ $action,
        /*# string */ $beforeEvent,
        /*# string */ $afterEvent,
        CacheItemInterface $item = null
    )/*# : bool */ {
        $param = ['item' => $item];
        if (!$this->trigger($beforeEvent, $param)) {
            return false;
        }
        if (!$this->driverAction($action, $item)) {
            $this->copyError($this->getDriver());
            return false;
        }
        if (!$this->trigger($afterEvent, $param)) {
            return false;
        }
        return $this->flushError();
    }
841966
public function addRow($data, $rowId = null)
    {
        if (($rowId === null) && isset($data['id'])) {
            $rowId = $data['id'];
        }

        if ($rowId === null) {
            $rowId = count($this->rows);
        }

        $this->rows[$rowId] = $data;

        return $this;
    }
1019574
public void insertDatum (Object element, int row)
    {
        _data.add(row, element);
        _model.fireTableRowsInserted(row, row);
    }
1036535
public function addItem($item = null, $action = null)
    {
        if (is_string($item)) {
            $item = ['Item', $item];
        } elseif (is_array($item)) {
            array_unshift($item, 'Item');
        } elseif (!$item) {
            $item = ['Item'];
        }

        $item = $this->add($item)->setElement('a');

        if (is_string($action) || is_array($action)) {
            $action = $this->url($action);
        }

        if (is_string($action)) {
            $item->setAttr('href', $action);
        }

        if ($action instanceof jsExpressionable) {
            $item->js('click', $action);
        }

        return $item;
    }
728000
protected function addRow(\Closure $callback)
    {
        $row = new DashboardLayoutRow();

        $callback($row);

        $this->rows[] = $row;

        return $this;
    }
1019909
public function add($row = []): CollectionInterface
    {
        //if it's an array
        if (is_array($row)) {
            //make it a model
            $row = $this->getModel($row);
        }

        //add it now
        $this->data[] = $row;

        return $this;
    }
512808
private function updateBoundColumns(array $row)
    {
        foreach ($this->columnBinding as $column => &$metadata) {
            $index = $this->collection->getColumnIndex($column);
            if ($index === null) {
                // todo: I would like to throw an exception and tell someone they screwed up
                // but i think that would violate the PDO api
                continue;
            }

            // Update by reference
            $value           = $this->typedValue($row[$index], $metadata['type']);
            $metadata['ref'] = $value;
        }
    }
984380
public function _prepareArrayRow(\Magento\Framework\DataObject $row)
    {
        $optionExtraAttr = [];
        $optionExtraAttr['option_' . $this->getStatusRenderer()
            ->calcOptionHash($row->getData('status'))]
                         = 'selected="selected"';
        $optionExtraAttr['option_' . $this->getAutomationRenderer()
            ->calcOptionHash($row->getData('automation'))]
                         = 'selected="selected"';
        $row->setData(
            'option_extra_attrs',
            $optionExtraAttr
        );
    }
152649
public function renderActionsRow($actions)
    {
        /* @var $rowPlugin     \SxBootstrap\View\Helper\Bootstrap\Form\Actions */
        /* @var $elementPlugin \SxBootstrap\View\Helper\Bootstrap\Form\Element */
        $rowPlugin     = $this->getView()->plugin('sxb_form_actions');
        $rowPlugin     = $rowPlugin();
        $elementPlugin = $this->getView()->plugin('sxb_form_element');

        if ($actions instanceof ElementInterface) {
            return $rowPlugin->addContent($elementPlugin($actions));
        }

        if (!is_array($actions)) {
            throw new Exception\RuntimeException(
                'Invalid actions type supplied'
            );
        }

        foreach ($actions as $action) {
            $rowPlugin->addContent($elementPlugin($action));
        }

        return $rowPlugin;
    }
919744
private function checkRowConsistency($row)
    {
        if ( $this->strict === false ) {
            return;
        }

        $current = count($row);

        if ( $this->rowConsistency === null ) {
            $this->rowConsistency = $current;
        }

        if ( $current !== $this->rowConsistency ) {
            throw new StrictViolationException();
        }

        $this->rowConsistency = $current;
    }
635671
public function isRelevant($action, $resource)
    {
        // Nested resources can be passed through a associative array, this way conditions which are
        // dependent upon the association will work when using a class.
        $resource = is_array($resource) ? head(array_keys($resource)) : $resource;
        return parent::isRelevant($action, $resource);
    }
295962
public function clickAndHold(WebDriverElement $element = null)
    {
        $this->action->addAction(
            new WebDriverClickAndHoldAction($this->mouse, $element)
        );

        return $this;
    }
781662
protected function addTableAction($action, $row, $btn)
    {
        if (empty($this->tableActions)) {
            $this->tableActions = new Collection();
        }
        $path = uri();
        Event::fire('datatables:' . $path . ':before.action.' . $action, [$this->tableActions, $row]);
        Event::fire(new BeforeTableAction($path, $action, $row, $this->tableActions));
        $this->tableActions->push($btn);
        Event::fire('datatables:' . $path . ':after.action.' . $action, [$this->tableActions, $row]);
        Event::fire(new AfterTableAction($path, $action, $row, $this->tableActions));
        Event::fire('datatables.' . get_class($this) . '.after.action.' . $action, [$this->tableActions, $row]);
        return $this;
    }
1228226
public function updateNodeSet(RowInterface $row, $propertyData)
    {
        $node = $row->getNode($propertyData['selector']);
        $value = $propertyData['value'];

        if ($value instanceof FunctionOperand) {
            $value = $propertyData['value'];
            $value = $value->execute($this->functionMapSet, $row);
        }

        $node->setProperty($propertyData['name'], $value);
    }