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