src/Http/Controllers/EntranceController.php
public function doReset(Request $request)
    {
        $existingReset = Password_reset::where('email', $request->email)
                                        ->where('token', $request->token)
                                        ->first();

        if ($existingReset !== null)
        {
            if ($request->password === $request->input('repeat-password'))
            {
                $user = User::where('email',$request->email)->first();
                $user->password = bcrypt($request->password);
                $user->save();

                $existingReset->delete();

                return redirect()->route('success');
            }
            else
            {
                $request->session()->flash('message', 'De ingevoerde wachtwoorden komen niet overeen.');
                return back()->withInput();
            }
        }
        else
        {
            $request->session()->flash('message', 'Het ingevoerde e-mail adres is onjuist.');
            return back()->withInput($request->except('email'));
        }
    }
public function doReset(Request $request)
    {
        $existingReset = Password_reset::where('email', $request->email)
                                        ->where('token', $request->token)
                                        ->first();

        if ($existingReset !== null)
        {
            if ($request->password === $request->input('repeat-password'))
            {
                $user = User::where('email',$request->email)->first();
                $user->password = bcrypt($request->password);
                $user->save();

                $existingReset->delete();

                return redirect()->route('success');
            }
            else
            {
                $request->session()->flash('message', 'De ingevoerde wachtwoorden komen niet overeen.');
                return back()->withInput();
            }
        }
        else
        {
            $request->session()->flash('message', 'Het ingevoerde e-mail adres is onjuist.');
            return back()->withInput($request->except('email'));
        }
    }
public function doReset ( Request $ request ) { $ existingReset = Password_reset :: where ( 'email' , $ request -> email ) -> where ( 'token' , $ request -> token ) -> first ( ) ; if ( $ existingReset !== null ) { if ( $ request -> password === $ request -> input ( 'repeat-password' ) ) { $ user = User :: where ( 'email' , $ request -> email ) -> first ( ) ; $ user -> password = bcrypt ( $ request -> password ) ; $ user -> save ( ) ; $ existingReset -> delete ( ) ; return redirect ( ) -> route ( 'success' ) ; } else { $ request -> session ( ) -> flash ( 'message' , 'De ingevoerde wachtwoorden komen niet overeen.' ) ; return back ( ) -> withInput ( ) ; } } else { $ request -> session ( ) -> flash ( 'message' , 'Het ingevoerde e-mail adres is onjuist.' ) ; return back ( ) -> withInput ( $ request -> except ( 'email' ) ) ; } }
Resets the users password.
@param Request $request
@return void
@author David Bikanov
Resets the users password .