public function enable(UserConfigurationListener $listener, User $user, AreaContract $area)
    {
        try {
            $userConfig = $this->getUserConfig($user, $area);

            $this->userConfigRepository->markAsEnabledById($userConfig->id);

            if ($this->isConfigured($area)) {
                $msg = trans('antares/two_factor_auth::configuration.responses.enable.success', ['area' => $area->getLabel()]);
                return $listener->afterConfiguration($area, $msg);
            }

            return $this->configure($listener, $area);
        } catch (Exception $e) {
            Log::emergency($e);

            $msg = trans('antares/two_factor_auth::configuration.responses.enable.fail', ['area' => $area->getLabel()]);

            return $listener->enableFailed($msg);
        }
    }
public function enable(UserConfigurationListener $listener, User $user, AreaContract $area)
    {
        try {
            $userConfig = $this->getUserConfig($user, $area);

            $this->userConfigRepository->markAsEnabledById($userConfig->id);

            if ($this->isConfigured($area)) {
                $msg = trans('antares/two_factor_auth::configuration.responses.enable.success', ['area' => $area->getLabel()]);
                return $listener->afterConfiguration($area, $msg);
            }

            return $this->configure($listener, $area);
        } catch (Exception $e) {
            Log::emergency($e);

            $msg = trans('antares/two_factor_auth::configuration.responses.enable.fail', ['area' => $area->getLabel()]);

            return $listener->enableFailed($msg);
        }
    }
public function enable ( UserConfigurationListener $ listener , User $ user , AreaContract $ area ) { try { $ userConfig = $ this -> getUserConfig ( $ user , $ area ) ; $ this -> userConfigRepository -> markAsEnabledById ( $ userConfig -> id ) ; if ( $ this -> isConfigured ( $ area ) ) { $ msg = trans ( 'antares/two_factor_auth::configuration.responses.enable.success' , [ 'area' => $ area -> getLabel ( ) ] ) ; return $ listener -> afterConfiguration ( $ area , $ msg ) ; } return $ this -> configure ( $ listener , $ area ) ; } catch ( Exception $ e ) { Log :: emergency ( $ e ) ; $ msg = trans ( 'antares/two_factor_auth::configuration.responses.enable.fail' , [ 'area' => $ area -> getLabel ( ) ] ) ; return $ listener -> enableFailed ( $ msg ) ; } }
Enable the provider for the user in the selected area.

@param UserConfigurationListener $listener
@param User $user
@param AreaContract $area
@return mixed
Enable the provider for the user in the selected area .