middleware('web'); $this->setupTheme(config('theme.themes.public.theme'), config('theme.themes.public.layout')); $this->repository = $updates; parent::__construct(); } /** * Show updates's list. * * @param string $slug * * @return response */ protected function index() { $updates = $this->repository ->pushCriteria(new \Litecms\Update\Repositories\Criteria\UpdatesPublicCriteria()) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->theme->of('update::public.updates.index', compact('updates'))->render(); } /** * Show updates. * * @param string $slug * * @return response */ protected function show($slug) { $updates = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->theme->of('update::public.updates.show', compact('updates'))->render(); } }