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