repository = $dbupload; parent::__construct(); } /** * Show dbupload's list. * * @param string $slug * * @return response */ protected function index() { $dbuploads = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$call::$dbupload.names')) ->view('$call::public.dbupload.index') ->data(compact('$dbuploads')) ->output(); } /** * Show dbupload's list based on a type. * * @param string $slug * * @return response */ protected function list($type = null) { $dbuploads = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$call::$dbupload.names')) ->view('$call::public.dbupload.index') ->data(compact('$dbuploads')) ->output(); } /** * Show dbupload. * * @param string $slug * * @return response */ protected function show($slug) { $dbupload = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->title($$dbupload->name . trans('$call::$dbupload.name')) ->view('$call::public.dbupload.show') ->data(compact('$dbupload')) ->output(); } }