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