/** * Display list of users of the application. * * @return \Illuminate\Http\Response */ public function users() { if (strcasecmp(Auth::user()->role, 'admin') == 0) { $users = User::where('id', '!=', Auth::user()->id)->get(); $data = array('user' => Auth::user(), 'users' => $users); return view('app.users', $data); } return redirect('/login'); }