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->title(trans('$test::$test.names')) ->view('$test::public.test.index') ->data(compact('$tests')) ->output(); } /** * Show test's list based on a type. * * @param string $slug * * @return response */ protected function list($type = null) { $tests = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$test::$test.names')) ->view('$test::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->title($$test->name . trans('$test::$test.name')) ->view('$test::public.test.show') ->data(compact('$test')) ->output(); } }