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