protected function getUserConfig(User $user, AreaContract $area)
    {
        $provider   = $this->twoFactorProvidersService->getEnabledInArea($area);
        $userConfig = $this->userConfigRepository->findByUserIdAndProviderId($user->id, $provider->getId());

        if ($userConfig) {
            return $userConfig;
        }

        $data = [
            'user_id'     => $user->id,
            'provider_id' => $provider->getId(),
        ];

        return $this->userConfigRepository->save($data);
    }
protected function getUserConfig(User $user, AreaContract $area)
    {
        $provider   = $this->twoFactorProvidersService->getEnabledInArea($area);
        $userConfig = $this->userConfigRepository->findByUserIdAndProviderId($user->id, $provider->getId());

        if ($userConfig) {
            return $userConfig;
        }

        $data = [
            'user_id'     => $user->id,
            'provider_id' => $provider->getId(),
        ];

        return $this->userConfigRepository->save($data);
    }
protected function getUserConfig ( User $ user , AreaContract $ area ) { $ provider = $ this -> twoFactorProvidersService -> getEnabledInArea ( $ area ) ; $ userConfig = $ this -> userConfigRepository -> findByUserIdAndProviderId ( $ user -> id , $ provider -> getId ( ) ) ; if ( $ userConfig ) { return $ userConfig ; } $ data = [ 'user_id' => $ user -> id , 'provider_id' => $ provider -> getId ( ) , ] ; return $ this -> userConfigRepository -> save ( $ data ) ; }
Returns user configuration from the repository. It will be stored in repository if it has not been stored yet.

@param User $user
@param AreaContract $area
@return \Antares\Modules\TwoFactorAuth\Contracts\UserConfig
Returns user configuration from the repository . It will be stored in repository if it has not been stored yet .