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