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