From 930fb379c7269fe78c19300c14cf709cbf00c7a0 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 14 Feb 2019 12:05:57 -0700 Subject: [PATCH] Update AdminController --- app/Http/Controllers/AdminController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index 7c9027538..c0645ae55 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -207,11 +207,11 @@ class AdminController extends Controller $order = $request->input('order') ?? 'desc'; $limit = $request->input('limit') ?? 12; if($search) { - $profiles = Profile::where('username','like', "%$search%")->orderBy('id','desc')->paginate($limit); + $profiles = Profile::select('id','username')->where('username','like', "%$search%")->orderBy('id','desc')->paginate($limit); } else if($filter && $order) { - $profiles = Profile::withCount(['likes','statuses','followers'])->orderBy($filter, $order)->paginate($limit); + $profiles = Profile::select('id','username')->withCount(['likes','statuses','followers'])->orderBy($filter, $order)->paginate($limit); } else { - $profiles = Profile::orderBy('id','desc')->paginate($limit); + $profiles = Profile::select('id','username')->orderBy('id','desc')->paginate($limit); } return view('admin.profiles.home', compact('profiles'));