 45db06a1bd
			
		
	
	
		45db06a1bd
		
			
		
	
	
	
	
		
			
			* refactor captcha * add default error message * prevent rule from being called multiple times * fixes * use config * Update this to latest * Remove this --------- Co-authored-by: Lance Pioch <git@lance.sh>
		
			
				
	
	
		
			27 lines
		
	
	
		
			563 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			563 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App\Filament\Components\Forms\Fields;
 | |
| 
 | |
| use App\Rules\ValidTurnstileCaptcha;
 | |
| use Filament\Forms\Components\Field;
 | |
| 
 | |
| class TurnstileCaptcha extends Field
 | |
| {
 | |
|     protected string $viewIdentifier = 'turnstile';
 | |
| 
 | |
|     protected string $view = 'filament.components.turnstile-captcha';
 | |
| 
 | |
|     protected function setUp(): void
 | |
|     {
 | |
|         parent::setUp();
 | |
| 
 | |
|         $this->hiddenLabel();
 | |
| 
 | |
|         $this->required();
 | |
| 
 | |
|         $this->after(function (TurnstileCaptcha $component) {
 | |
|             $component->rule(new ValidTurnstileCaptcha());
 | |
|         });
 | |
|     }
 | |
| }
 |