public function getIndex() { $models = Promotion::orderBy($this->sortBy, $this->orderBy)->paginate($this->perpage); $data = ['models' => $models, 'sortBy' => $this->sortBy, 'orderBy' => $this->orderBy]; return view('redminportal::promotions/view', $data); }