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