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