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