Krucas\LaravelUserEmailVerification\DatabaseTokenRepository::exists PHP Method

exists() public method

Determine if a token record exists and is valid.
public exists ( Krucas\LaravelUserEmailVerification\Contracts\RequiresEmailVerification $user, string $token ) : boolean
$user Krucas\LaravelUserEmailVerification\Contracts\RequiresEmailVerification
$token string
return boolean
    public function exists(Contracts\RequiresEmailVerification $user, $token)
    {
        $email = $user->getEmailForVerification();
        $token = (array) $this->getTable()->where('email', $email)->where('token', $token)->first();
        return $token && !$this->tokenExpired($token);
    }