public function getIndex() { $medias = Media::orderBy('created_at', 'desc')->orderBy('category_id')->orderBy('name')->paginate(20); return view('redminportal::medias/view')->with('medias', $medias); }
public function getIndex() { $models = Media::orderBy($this->sortBy, $this->orderBy)->paginate($this->perpage); $data = ['models' => $models, 'sortBy' => $this->sortBy, 'orderBy' => $this->orderBy]; return view('redminportal::medias/view', $data); }