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