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