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('order::detail.names')) ->view('order::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('order::detail.name')) ->view('order::public.detail.show') ->data(compact('detail')) ->output(); } }