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