- What is stoakes/form-bundle used for?
- stoakes/form-bundle provides reusable form definitions and extra field types for PHP applications, including Captcha GD, TinyMCE, reCAPTCHA, and jQuery-based date, autocomplete, slider, file, and image widgets. It is intended to centralize form structure and reduce duplication across projects. In a Laravel app you would typically use it as a Composer dependency and wrap its form rendering in your own controllers or Blade views.
- How do I install stoakes/form-bundle in a Laravel project?
- Install it with Composer using composer require stoakes/form-bundle. Because the package is distributed as a bundle rather than a Laravel package, you may need to register any service provider or autoload configuration manually. After installation, publish or configure the assets required by TinyMCE, reCAPTCHA, and the jQuery widgets before rendering forms.
- Is stoakes/form-bundle compatible with Laravel?
- It is a PHP form bundle, not a Laravel-specific package, so Laravel compatibility depends on how its form classes and assets are integrated. You can use it inside Laravel via Composer, but expect to add your own service provider bindings, Blade templates, and asset includes. Check the repository and Packagist metadata for PHP and Laravel version support before committing.
- How do I add a CAPTCHA field with stoakes/form-bundle?
- The package includes a Captcha GD form type, so you define it as part of your form structure and render the generated CAPTCHA image in your template. You will need to ensure the GD extension is enabled in PHP and that the CAPTCHA answer is validated on submission. In Laravel, wire the validation into your request handling or a custom validation rule.
- Can I use TinyMCE with stoakes/form-bundle?
- Yes, the package lists a TinyMCE form widget for rendering rich-text fields. You still need to include the TinyMCE JavaScript assets and initialize the editor in your page. The bundle helps with form definition and rendering, but front-end asset management remains your application's responsibility.
- How does reCAPTCHA work in stoakes/form-bundle?
- stoakes/form-bundle provides a reCAPTCHA form type for adding the widget to your forms. You must supply your site key and secret key and verify the response server-side with Google's reCAPTCHA API. The package handles the form field, but the verification and error handling should be implemented in your application.
- How do I configure the jQuery date, autocomplete, slider, file, and image fields?
- These field types are part of the package's extra form widgets and are configured when you define the form fields. You will need to include jQuery and the relevant jQuery UI or plugin assets in your layout. Check each widget's options in the repository source or documentation, since the README excerpt does not list every configuration key.
- Does stoakes/form-bundle handle Laravel validation and CSRF tokens?
- No, the bundle focuses on form definition and rendering rather than Laravel's request validation or CSRF protection. In Laravel you should keep using FormRequest validation, the VerifyCsrfToken middleware, and Blade's csrf_field helper. The package's fields can coexist with those Laravel features, but you must connect them in your controllers and templates.
- How should I test forms built with stoakes/form-bundle?
- Unit-test your form definitions and any custom field types in isolation, then use Laravel's HTTP tests to submit rendered forms and assert validation, CAPTCHA, and reCAPTCHA behavior with mocked services. For front-end widgets such as TinyMCE and jQuery UI, add browser tests only if the interaction is critical. Keep external CAPTCHA and reCAPTCHA calls out of deterministic test runs.
- Is stoakes/form-bundle still maintained, and what are the alternatives?
- Maintenance status should be verified on the GitHub repository and Packagist before using it in production, since bundle-style packages can lag behind current Laravel releases. If activity is low, evaluate Laravel-native alternatives such as Blade components, Livewire, Laravel Collective, or dedicated TinyMCE and reCAPTCHA integrations. stoakes/form-bundle remains useful when its bundled form organization matches your architecture.