Example #1
0
 /**
  * Table actions View Generator for Orchestra\Model\User.
  *
  * @param  \Orchestra\Contracts\Html\Table\Builder  $table
  *
  * @return \Orchestra\Contracts\Html\Table\Builder
  */
 public function actions(TableBuilder $table)
 {
     return $table->extend(function (TableGrid $table) {
         $table->column('actions')->label('')->escape(false)->headers(['class' => 'th-action'])->attributes(function () {
             return ['class' => 'th-action'];
         })->value($this->getActionsColumn());
     });
 }
Example #2
0
 /**
  * Table actions View Generator for Orchestra\Model\User.
  *
  * @param  \Orchestra\Contracts\Html\Table\Builder  $table
  *
  * @return \Orchestra\Contracts\Html\Table\Builder
  */
 public function actions(TableBuilder $table)
 {
     return $table->extend(function (TableGrid $table) {
         $table->column('action')->label('Action')->escape(false)->attributes(function () {
             return ['class' => 'th-action'];
         })->value(function ($row) {
             $html = [app('html')->link(handles("orchestra::media/profile/{$row->id}/edit"), trans('orchestra/foundation::label.edit'), ['class' => 'btn btn-xs btn-warning'])];
             $roles = [(int) $this->config->get('orchestra/foundation::media.admin'), (int) $this->config->get('orchestra/foundation::media.member')];
             if (!in_array((int) $row->id, $roles)) {
                 $html[] = app('html')->link(handles("orchestra::media/profile/{$row->id}/delete", ['csrf' => true]), trans('orchestra/foundation::label.delete'), ['class' => 'btn btn-xs btn-danger']);
             }
             return app('html')->create('div', app('html')->raw(implode('', $html)), ['class' => 'btn-group']);
         });
     });
 }