/**
  * Metodo para hacer la busqueda de un categorye
  */
 public static function search()
 {
     $items = array();
     $search = '';
     if (Input::get('search')) {
         $search = Input::get('search');
         $arrparam = explode(' ', $search);
         $items = Category::whereNested(function ($q) use($arrparam) {
             $p = $arrparam[0];
             $q->whereNested(function ($q) use($p) {
                 $q->where('name', 'LIKE', '%' . $p . '%');
                 $q->orwhere('description', 'LIKE', '%' . $p . '%');
                 $q->orwhere('enable', 'LIKE', '%' . $p . '%');
             });
             $c = count($arrparam);
             if ($c > 1) {
                 for ($i = 1; $i < $c; $i++) {
                     $p = $arrparam[$i];
                     $q->whereNested(function ($q) use($p) {
                         $q->where('name', 'LIKE', '%' . $p . '%');
                         $q->orwhere('description', 'LIKE', '%' . $p . '%');
                         $q->orwhere('enable', 'LIKE', '%' . $p . '%');
                     }, 'OR');
                 }
             }
         })->whereNull('deleted_at')->orderBy('name', 'ASC')->paginate(10);
         return View::make('category.view_category', compact('items', 'search'));
     }
 }