Example #1
0
 public function draggable($url)
 {
     self::$draggable = $url;
     return $this;
 }
 public static function table($object, $fields, $instances)
 {
     if (count($instances)) {
         $table = new Table();
         $table->rows($instances);
         foreach ($fields as $field) {
             $table->column($field->name, $field->type, $field->title, $field->width, $field->height);
         }
         $table->column('updated_at', 'updated_at', trans('avalon::messages.site_updated_at'));
         if ($object->can_edit) {
             $table->deletable();
             if ($object->order_by == 'precedence') {
                 $table->draggable(URL::action('InstanceController@reorder', $object->name));
             }
         }
         if (!empty($object->group_by_field)) {
             $table->groupBy('group');
         }
         return $table->draw();
     }
 }