Form, Table, Page). No need for custom middleware or deep Laravel core modifications.Gregwar/Captcha library handles image generation and validation, abstracting complexity from the application layer.config/filament-captcha.php), allowing adjustments to captcha difficulty, styling, and behavior.TextInput, Textarea, etc., by adding a captcha field type (CaptchaField). No breaking changes to existing forms.composer.json.gregwar/captcha) may have security or compatibility issues with newer PHP/Laravel versions. Test thoroughly post-upgrade.composer.json constraints). Ensure alignment with Laravel’s supported versions.failed_jobs table for retries).composer require marcogermani87/filament-captcha
^1.0) to avoid breaking changes.app/Providers/FilamentPluginServiceProvider.php:
Filament::registerPlugin(
Marcogermani87\FilamentCaptcha\FilamentCaptchaPlugin::make()
);
CaptchaField in Filament forms:
use Marcogermani87\FilamentCaptcha\Fields\CaptchaField;
public static function form(Form $form): Form {
return $form
->schema([
// ... other fields
CaptchaField::make('captcha')
->label('Verify you are human')
->required(),
]);
}
php artisan vendor:publish --provider="Marcogermani87\FilamentCaptcha\FilamentCaptchaServiceProvider"
Adjust config/filament-captcha.php for:
storage/app/captcha).spatie/laravel-filament-spa-resources) with no conflicts.filament/spatie-laravel-resource-tables).gregwar/captcha).spatie/laravel-honeypot).storage/app/captcha).CaptchaField is included in the form and marked as required.FilamentCaptcha::debug() in config to log captcha generation.dd() or dump() in CaptchaField methods for custom debugging.local for dev, s3 for prod) with proper caching headers.throttle middleware to prevent abuse.storage:link with regional buckets).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Captcha image generation fails | Forms break; users can’t submit. | Fallback to a static "I’m not a robot" checkbox or manual review. |
| Storage permissions denied | Captcha images missing. | Automate permission checks in bootstrap/app.php or a service provider. |
| Bot bypasses captcha | Spam submissions. | Layer with honeypot fields or `spatie/laravel-hone |
How can I help you explore Laravel packages today?