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