src/Traits/TwoFactorAuthenticatesUsers.php
protected function invalidateTwoFactorBackup(AuthenticatableTwoFactorContract $user, int $token): void
    {
        $settings = $user->getTwoFactor();
        $backup = array_get($settings, 'totp.backup');

        unset($backup[array_search($token, $backup)]);

        array_set($settings, 'totp.backup', $backup);

        // Update TwoFactor OTP backup codes
        $user->fill(['two_factor' => $settings])->forceSave();
    }
protected function invalidateTwoFactorBackup(AuthenticatableTwoFactorContract $user, int $token): void
    {
        $settings = $user->getTwoFactor();
        $backup = array_get($settings, 'totp.backup');

        unset($backup[array_search($token, $backup)]);

        array_set($settings, 'totp.backup', $backup);

        // Update TwoFactor OTP backup codes
        $user->fill(['two_factor' => $settings])->forceSave();
    }
protected function invalidateTwoFactorBackup ( AuthenticatableTwoFactorContract $ user , int $ token ) : void { $ settings = $ user -> getTwoFactor ( ) ; $ backup = array_get ( $ settings , 'totp.backup' ) ; unset ( $ backup [ array_search ( $ token , $ backup ) ] ) ; array_set ( $ settings , 'totp.backup' , $ backup ) ; // Update TwoFactor OTP backup codes $ user -> fill ( [ 'two_factor' => $ settings ] ) -> forceSave ( ) ; }
Invalidate given backup code for the given user.

@param \Rinvex\Auth\Contracts\AuthenticatableTwoFactorContract $user
@param int                                                     $token

@return void
Invalidate given backup code for the given user .