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