/** * Show Downloads */ public function getDownloads($paginateItems = 50) { $items = $this->query()->paginate($paginateItems); $items['regrouped'] = $this->regroupByName($items); $items['index'] = array_flip(array_keys($items['regrouped'])); app('veer')->loadedComponents['temporary'] = \Veer\Models\Download::where('original', '=', 0)->count(); app('veer')->loadedComponents['counted'] = \Veer\Models\Download::count(\Illuminate\Support\Facades\DB::raw('DISTINCT fname')); return $items; }