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