app/controllers/PasswordController.php
/**
	 * Update the specified resource in storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
Update the specified resource in storage.
@param  int  $id
@return Response
Update the specified resource in storage . @param int $id @return Response
public function update()
	{
        DD(User::find(1)->updated_at . '   ' . User::find(1)->last_login);
		$old = Input::get('a');
        $new = Input::get('b');
        if (Hash::check($old, Auth::user()->password))
        {
            try
            {
                $user = User::find(Auth::user()->id);
                $user->password = Hash::make($new);
                $user->save();
            }catch(Exception $e)
            {
                $error = new Error();
                $error->message = 'User: ' . Auth::user()->id . '  Message: ' . $e->getMessage();
                $error->line = $e->getLine();
                $error->file = 'PasswordController.php';
                $error->time = time();
                $error->save();
                return [0, 'Password failed to updated because: ' . $e->getMessage() . ' at line ' . $e->getLine()];
            }
            return [1,'Password updated successfully!'];
        }
        else
        {
            return [0,'Old password doesn\'t match account.'];
        }
	}
public function update ( ) { DD ( User :: find ( 1 ) -> updated_at . '   ' . User :: find ( 1 ) -> last_login ) ; $ old = Input :: get ( 'a' ) ; $ new = Input :: get ( 'b' ) ; if ( Hash :: check ( $ old , Auth :: user ( ) -> password ) ) { try { $ user = User :: find ( Auth :: user ( ) -> id ) ; $ user -> password = Hash :: make ( $ new ) ; $ user -> save ( ) ; } catch ( Exception $ e ) { $ error = new Error ( ) ; $ error -> message = 'User: ' . Auth :: user ( ) -> id . '  Message: ' . $ e -> getMessage ( ) ; $ error -> line = $ e -> getLine ( ) ; $ error -> file = 'PasswordController.php' ; $ error -> time = time ( ) ; $ error -> save ( ) ; return [ 0 , 'Password failed to updated because: ' . $ e -> getMessage ( ) . ' at line ' . $ e -> getLine ( ) ] ; } return [ 1 , 'Password updated successfully!' ] ; } else { return [ 0 , 'Old password doesn\'t match account.' ] ; } }
Update the specified resource in storage.
Update the specified resource in storage .