Ejemplo n.º 1
0
 public function getTotalProfile()
 {
     if (!Cache::has('totalInstagramProfiles')) {
         $data['total'] = InstagramProfile::count();
         Cache::put('totalInstagramProfiles', $data, 1440);
     }
     return Cache::get('totalInstagramProfiles');
 }
Ejemplo n.º 2
0
 public function getTotalProfile($category = 'all')
 {
     if (!Cache::has('total' . ucfirst($category) . 'InstagramProfiles')) {
         $is_have_category = false;
         $id_category = NULL;
         if ($category != 'all') {
             $category_search = InstagramCategory::whereCategory($category)->first();
             if ($category_search) {
                 $id_category = $category_search->id_category;
                 $is_have_category = true;
             } else {
                 return 'Invalid method';
             }
         }
         if ($is_have_category) {
             $data['total'] = InstagramProfile::whereCategory($category)->count();
         } else {
             $data['total'] = InstagramProfile::count();
         }
         Cache::put('totalInstagramProfiles', $data, 1440);
     }
     return Cache::get('totalInstagramProfiles');
 }