src/Http/Controllers/Adminarea/AccountTwoFactorController.php
public function backupTotp(AccountTwoFactorTotpBackupRequest $request)
    {
        $currentUser = $request->user($this->getGuard());
        $twoFactor = $currentUser->getTwoFactor();
        $twoFactor['totp']['backup'] = $this->generateTotpBackups();
        $twoFactor['totp']['backup_at'] = now()->toDateTimeString();

        $currentUser->fill(['two_factor' => $twoFactor])->forceSave();

        return intend([
            'back' => true,
            'with' => ['success' => trans('cortex/auth::messages.verification.twofactor.totp.rebackup')],
        ]);
    }
public function backupTotp(AccountTwoFactorTotpBackupRequest $request)
    {
        $currentUser = $request->user($this->getGuard());
        $twoFactor = $currentUser->getTwoFactor();
        $twoFactor['totp']['backup'] = $this->generateTotpBackups();
        $twoFactor['totp']['backup_at'] = now()->toDateTimeString();

        $currentUser->fill(['two_factor' => $twoFactor])->forceSave();

        return intend([
            'back' => true,
            'with' => ['success' => trans('cortex/auth::messages.verification.twofactor.totp.rebackup')],
        ]);
    }
public function backupTotp ( AccountTwoFactorTotpBackupRequest $ request ) { $ currentUser = $ request -> user ( $ this -> getGuard ( ) ) ; $ twoFactor = $ currentUser -> getTwoFactor ( ) ; $ twoFactor [ 'totp' ] [ 'backup' ] = $ this -> generateTotpBackups ( ) ; $ twoFactor [ 'totp' ] [ 'backup_at' ] = now ( ) -> toDateTimeString ( ) ; $ currentUser -> fill ( [ 'two_factor' => $ twoFactor ] ) -> forceSave ( ) ; return intend ( [ 'back' => true , 'with' => [ 'success' => trans ( 'cortex/auth::messages.verification.twofactor.totp.rebackup' ) ] , ] ) ; }
Process the TwoFactor OTP backup.

@param \Cortex\Auth\Http\Requests\Adminarea\AccountTwoFactorTotpBackupRequest $request

@return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
Process the TwoFactor OTP backup .