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