Exemple #1
0
 /**
  * Perform ordering
  * @param  array  $orders
  * @param  array  $columns
  * @return self
  */
 public function dtOrder(array $orders, array $columns)
 {
     foreach ($orders as $order) {
         if (isset($columns[$order['column']]) && filter_var($columns[$order['column']]['orderable'], FILTER_VALIDATE_BOOLEAN) && !in_array($columns[$order['column']]['name'], $this->dtUnsortable)) {
             $this->dtModel = $this->dtModel->orderByRaw($columns[$order['column']]['name'] . ' ' . ($order['dir'] == 'asc' ? 'asc' : 'desc'));
         }
     }
     return $this;
 }