src/Http/Controllers/Adminarea/AccountTwoFactorController.php
public function enablePhone(AccountTwoFactorPhoneRequest $request)
    {
        $currentUser = $request->user($this->getGuard());
        $currentUser->routeNotificationForAuthy();
        $twoFactor = $currentUser->getTwoFactor();
        $twoFactor['phone']['enabled'] = true;

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

        return intend([
            'back' => true,
            'with' => ['success' => trans('cortex/auth::messages.verification.twofactor.phone.enabled')],
        ]);
    }
public function enablePhone(AccountTwoFactorPhoneRequest $request)
    {
        $currentUser = $request->user($this->getGuard());
        $currentUser->routeNotificationForAuthy();
        $twoFactor = $currentUser->getTwoFactor();
        $twoFactor['phone']['enabled'] = true;

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

        return intend([
            'back' => true,
            'with' => ['success' => trans('cortex/auth::messages.verification.twofactor.phone.enabled')],
        ]);
    }
public function enablePhone ( AccountTwoFactorPhoneRequest $ request ) { $ currentUser = $ request -> user ( $ this -> getGuard ( ) ) ; $ currentUser -> routeNotificationForAuthy ( ) ; $ twoFactor = $ currentUser -> getTwoFactor ( ) ; $ twoFactor [ 'phone' ] [ 'enabled' ] = true ; $ currentUser -> fill ( [ 'two_factor' => $ twoFactor ] ) -> forceSave ( ) ; return intend ( [ 'back' => true , 'with' => [ 'success' => trans ( 'cortex/auth::messages.verification.twofactor.phone.enabled' ) ] , ] ) ; }
Enable TwoFactor Phone authentication.

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

@return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
Enable TwoFactor Phone authentication .