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