"string", 'rawId' => "string", 'response' => "string", 'response.clientDataJSON' => "string", 'response.attestationObject' => "string", 'type' => "string" ])] public function rules(): array { return [ 'id' => 'required|string', 'rawId' => 'required|string', 'response' => 'required|array', 'response.clientDataJSON' => 'required|string', 'response.attestationObject' => 'required|string', 'type' => 'required|string', ]; } /** * Handle a passed validation attempt. * * @return void * @throws \Illuminate\Contracts\Container\BindingResolutionException */ protected function passedValidation(): void { $this->credential = $this->container->make(AttestationValidator::class) ->send(new AttestationValidation($this->user(), $this)) ->then(static function (AttestationValidation $validation): WebAuthnCredential { return $validation->credential; }); } /** * Save and return the generated WebAuthn Credentials. * * @param array|callable $saving * @return string */ public function save(array|callable $saving = []): string { is_callable($saving) ? $saving($this->credential) : $this->credential->forceFill($saving); $this->credential->save(); CredentialCreated::dispatch($this->user(), $this->credential); return $this->credential->getKey(); } }