public function getMyProfile($id) { if (Auth::user()->can(['can_manage_users']) or Auth::user()->id == $id) { $user = User::with('office')->find($id); return view('admin/users/my_profile', compact('user')); } return 'You are unauthorized to edit a users profile'; }