Closed imClement closed 1 year ago
can you please share the code, where you include the ReCaptcha with? or a repo where I can test it?
Thank you for the quick reply.
Per package instructions I created app/Http/Livewire/Auth/Register.php
namespace App\Http\Livewire\Auth;
use AbanoubNassem\FilamentGRecaptchaField\Forms\Components\GRecaptcha;
use JeffGreco13\FilamentBreezy\Http\Livewire\Auth\Register as FilamentBreezyRegister;
class Register extends FilamentBreezyRegister
{
// Define the new attributes
public $captcha;
// Override the getFormSchema method and merge the default fields then add your own.
protected function getFormSchema(): array
{
return array_merge(parent::getFormSchema(),[
GRecaptcha::make('captcha')
]);
}
// Use this method to modify the preparedData before the register() method is called.
protected function prepareModelData($data): array
{
$preparedData = parent::prepareModelData($data);
$preparedData['captcha'] = $this->captcha;
return $preparedData;
}
}
The ReCaptcha is correctly displayed in the register form and is is working by presenting challenges and allow me to solve it.
The problem is when I click the Register button the form return "The field is required." under the Recaptcha field.
Here is the vendor class that is extended by the above file:
https://github.com/jeffgreco13/filament-breezy/blob/1.x/src/Http/Livewire/Auth/Register.php
@im-Clement @imClement
please update to version 0.0.3
, and make sure that
// Define the new attributes
public $captcha = '' ;
the captcha property is initialized .
please test , and let me know if it works, thank you.
It works.
Thank you very much for the quick and effective reaction.
Hi,
I am trying to implement recaptcha into the Register form of https://github.com/jeffgreco13/filament-breezy
While the ReCaptcha is displayed correctly and checked (green) I get "The field is required." after submit.
Any suggestion is appreciated.
Thank you,