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