/**
  * Update the password
  *
  * @param Request $request
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  * @throws \Illuminate\Foundation\Validation\ValidationException
  */
 public function updatePassword(Request $request)
 {
     // Validate the password length
     $validator = $this->validator($request->all());
     if ($validator->fails()) {
         $this->throwValidationException($request, $validator);
     }
     // Get the currently logged chiefWardenStaff
     $chiefWardenStaff = ChiefWardenStaff::find(Auth::guard('chiefWardenStaff')->user()->id);
     $newPassword = $request['password'];
     $chiefWardenStaff->password = bcrypt($newPassword);
     $chiefWardenStaff->firstLogin = false;
     $chiefWardenStaff->save();
     return redirect('/chiefWardenStaffs/home');
 }
 /**
  * Update user password
  *
  * @param Request $request
  * @return mixed
  */
 public function updatePassword(Request $request)
 {
     // Get the logged in user
     $chiefWardenStaff = ChiefWardenStaff::find(Auth::guard('chiefWardenStaff')->user()->id);
     $newPassword = $request['password'];
     // Validate the password
     $this->validate($request, ['password' => 'required|min:8']);
     // Save updated password
     $chiefWardenStaff->password = bcrypt($newPassword);
     $chiefWardenStaff->save();
     return redirect()->back()->with('status', 'Success');
 }