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