public function search($input, $getResults = true)
 {
     $query = ElementSetHasUser::query();
     $columns = Schema::getColumnListing('elementSetHasUsers');
     $attributes = array();
     foreach ($columns as $attribute) {
         if (isset($input[$attribute]) and !empty($input[$attribute])) {
             $query->where($attribute, $input[$attribute]);
             $attributes[$attribute] = $input[$attribute];
         } else {
             $attributes[$attribute] = null;
         }
     }
     if ($getResults) {
         return [$query->get(), $attributes];
     } else {
         return $query;
     }
 }
 /**
  * @return \Illuminate\Database\Eloquent\Builder
  */
 protected function getQuery()
 {
     return ElementSetHasUser::query();
 }