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