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->title(trans('$payment::$payment.names')) ->view('$payment::public.payment.index') ->data(compact('$payments')) ->output(); } /** * Show payment's list based on a type. * * @param string $slug * * @return response */ protected function list($type = null) { $payments = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(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->title($$payment->name . trans('$payment::$payment.name')) ->view('$payment::public.payment.show') ->data(compact('$payment')) ->output(); } }