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('plan::subscription.names')) ->view('plan::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('plan::subscription.name')) ->view('plan::public.subscription.show') ->data(compact('subscription')) ->output(); } }