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