- Is aburg/cap-bundle compatible with Laravel, or is it strictly for Symfony?
- This bundle is designed for Symfony projects using Flex, Stimulus/Turbo, and AssetMapper. Laravel’s architecture (service container, routing, and asset pipelines) differs significantly, so direct integration isn’t supported. You’d need to build a custom middleware or service to replicate CAP logic in Laravel.
- How do I integrate CAPTCHA in Laravel without Symfony’s bundle?
- For Laravel, use CAP’s official JavaScript client directly in your frontend (e.g., with Alpine.js or Livewire) and validate tokens via a custom middleware or service calling the CAP API. Avoid relying on Symfony’s Stimulus/Turbo dependencies.
- What Laravel alternatives to aburg/cap-bundle exist for CAPTCHA?
- Consider Laravel-native packages like `spatie/laravel-honeypot` for simple bot protection, or third-party CAPTCHA services with Laravel SDKs (e.g., Google reCAPTCHA via `bestmomo/laravel-recaptcha`). These avoid Symfony’s ecosystem entirely.
- Does aburg/cap-bundle work offline or in air-gapped Laravel deployments?
- No—this bundle depends on the external CAP API (trycap.dev). For offline use, you’d need to mock API responses or implement a local CAPTCHA service, which isn’t supported by the bundle’s design.
- How would I load CAP’s JavaScript in Laravel (e.g., with Vite or Mix)?
- Publish CAP’s JS client manually via Laravel Mix/Vite (e.g., `resources/js/cap.js`) and include it in your Blade/Inertia templates. Avoid Symfony’s AssetMapper, as it won’t work in Laravel’s asset pipeline.
- Can I use aburg/cap-bundle with Laravel’s Livewire or Alpine.js?
- The bundle’s Stimulus/Turbo integration won’t work directly, but you can adapt CAP’s logic to Alpine.js or Livewire by loading the CAP client JS separately and handling token validation via Laravel’s middleware or Livewire hooks.
- What Laravel versions support a CAPTCHA integration like aburg/cap-bundle?
- Laravel 8+ is recommended for modern CAPTCHA integrations due to improved middleware and service container features. The bundle itself doesn’t support Laravel, but a custom implementation would work across versions with minor adjustments.
- How do I handle CAP token validation in Laravel without Symfony’s DI?
- Create a Laravel middleware (e.g., `CapMiddleware`) to validate tokens via API calls to `trycap.dev`. Store tokens in the session or database temporarily, then verify them on form submission using Laravel’s built-in validation rules.
- What are the performance implications of using CAP in Laravel?
- CAP introduces API latency on form submission (e.g., token validation calls). Optimize by caching API responses or using a local fallback. Test with tools like Laravel Debugbar to measure impact on page load times.
- Is aburg/cap-bundle actively maintained, or should I look for alternatives?
- The bundle has no stars or dependents, indicating low adoption. For production Laravel apps, prioritize mature alternatives like `spatie/laravel-honeypot` or third-party CAPTCHA services with dedicated Laravel support and active maintenance.