DarkGhostHunter / Laraguard

"On-premises 2FA Authentication for all your users out-of-the-box
MIT License
266 stars 24 forks source link

Suggestion: getAvailableCodes #73

Closed aeq-dev closed 2 years ago

aeq-dev commented 2 years ago

Hi, You may add this scope to get only available codes, something like this :

 public function getAvailableCodes(): Collection
    {
        return $this->twoFactorAuth->recovery_codes->whereNull('used_at') ?? collect();
    }

Thanks

DarkGhostHunter commented 2 years ago

Sorry but I don't see a compelling reason to add a getter since you can add it to your model instead.