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