create(); $this->assertFalse($user->hasWebauthnCredentials()); WebauthnCredential::create([ 'user_id' => $user->id, 'name' => 'YubiKey 5C', 'credential_id' => 'abc', 'public_key' => '{}', 'sign_count' => 0, ]); $this->assertTrue($user->fresh()->hasWebauthnCredentials()); $this->assertCount(1, $user->fresh()->webauthnCredentials); } }