public function runUpdate(Request $request)
    {
        $user = User::find(Auth::id());
        $this->validate($request, [
            'old' => 'required',
            'password' => 'required|min:8|confirmed',
        ]);
        if (Auth::attempt(['name' => $user->name, 'password' => $request->old])) {
            $user->fill([ 'password' => bcrypt($request->password) ])->save();
            $request->session()->flash('success', 'Your password has been changed.');
            return redirect('/my-profile');
        }
        $request->session()->flash('failure', 'Your password has not been changed.');
        return redirect('/my-profile');
    }
public function runUpdate(Request $request)
    {
        $user = User::find(Auth::id());
        $this->validate($request, [
            'old' => 'required',
            'password' => 'required|min:8|confirmed',
        ]);
        if (Auth::attempt(['name' => $user->name, 'password' => $request->old])) {
            $user->fill([ 'password' => bcrypt($request->password) ])->save();
            $request->session()->flash('success', 'Your password has been changed.');
            return redirect('/my-profile');
        }
        $request->session()->flash('failure', 'Your password has not been changed.');
        return redirect('/my-profile');
    }
public function runUpdate ( Request $ request ) { $ user = User :: find ( Auth :: id ( ) ) ; $ this -> validate ( $ request , [ 'old' => 'required' , 'password' => 'required|min:8|confirmed' , ] ) ; if ( Auth :: attempt ( [ 'name' => $ user -> name , 'password' => $ request -> old ] ) ) { $ user -> fill ( [ 'password' => bcrypt ( $ request -> password ) ] ) -> save ( ) ; $ request -> session ( ) -> flash ( 'success' , 'Your password has been changed.' ) ; return redirect ( '/my-profile' ) ; } $ request -> session ( ) -> flash ( 'failure' , 'Your password has not been changed.' ) ; return redirect ( '/my-profile' ) ; }
Update the password for the user.

@param  Request  $request
@return Response
Update the password for the user .