Example #1
0
 /**
  * @param $instance
  * @param bool $active
  * @return string
  */
 protected function destroyButton($instance, $active = true)
 {
     if ($active == false) {
         return '';
     }
     return view('admin::_partials.button')->with('type', self::DELETE_BUTTON)->with('link', $this->router->routeToDestroy($this->modelItem->getAlias(), $instance->getKey()))->with('data-toggle', 'tooltip')->with('title', Lang::get('admin::lang.table.delete'));
 }
Example #2
0
 /**
  * @param $instance
  * @param bool $active
  * @return string
  */
 protected function destroyButton($instance, $active = true)
 {
     $content = '';
     $content .= $this->formBuilder->open(['method' => 'delete', 'url' => $this->router->routeToDestroy($this->modelItem->getAlias(), $instance->getKey()), 'class' => 'inline-block']);
     $attributes = ['class' => 'btn btn-danger btn-sm btn-delete', 'type' => 'submit', 'data-toggle' => 'tooltip', 'title' => Lang::get('admin::lang.table.delete')];
     if (!$active) {
         $attributes[] = 'disabled';
     }
     $content .= $this->htmlBuilder->tag('button', $attributes, '<i class="fa fa-times"></i>');
     $content .= $this->formBuilder->close();
     return $content;
 }