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