- What is scafera/form and what problem does it solve?
- Scafera Form is a Laravel package for defining, rendering, and handling forms in a structured, reusable way. It solves the problem of scattering form markup, validation rules, and request handling across views and controllers by letting you describe a form once. The package is aimed at teams that want consistent, maintainable form schemas instead of repetitive boilerplate.
- How do I install scafera/form in a Laravel application?
- Install it with Composer using composer require scafera/form, then follow the package README for any Laravel service provider or configuration publishing steps. Confirm that your application meets the Laravel and PHP constraints declared in the package composer.json. Because this is a Laravel package, it should fit into normal Composer-based Laravel deployment workflows.
- Which Laravel and PHP versions does scafera/form support?
- The provided overview does not list exact Laravel or PHP version constraints. Check the package composer.json and README for the supported matrix, and confirm the v1.0.1 release is compatible with your application before upgrading. The technical assessment also recommends validating Composer constraints and PHP version support as part of integration.
- How do I define a form with scafera/form?
- You describe a form once as a declarative schema built from reusable field classes. This keeps markup, validation rules, and request handling from being spread across views and controllers. The exact API and examples should be taken from the package README, since the provided excerpt does not include code samples.
- How does validation work with scafera/form fields?
- Validation is integrated with the field definitions so rules stay in sync with the form schema. The v1.0.1 release notes mention stable validator rule IDs, which can give validation failures durable identifiers. Confirm in the README whether those IDs are exposed in validation error payloads or only used internally.
- Can I render scafera/form forms in Blade templates?
- Yes. The package provides Blade rendering with sensible, overridable defaults. You can keep form markup consistent across the application while still customizing views where your design requires it.
- How do I create custom field types in scafera/form?
- The package supports extensible field types for custom inputs and components. You define reusable field classes and integrate them into your declarative form schemas. Check the README for the exact extension points and any required methods.
- How does scafera/form handle form submissions and model mapping?
- The package includes clean submission handling for mapping validated data to models. That helps avoid repetitive controller boilerplate when processing forms. Before production use, confirm the README's conventions for mapping, authorization, and any custom submission behavior.
- Are scafera/form validation rule IDs stable enough for production use?
- Treat v1.0.1 as an additive minor release: stable rule IDs are low risk if they do not change behavior, but they become a contract if clients, logs, or support tooling depend on them. Confirm that IDs are documented, unique, deterministic, stable across package versions, and safe for nested or custom validation. Pin the version, run validation and error-contract tests, and avoid exposing IDs to API clients until the contract is reviewed.
- How does scafera/form compare with Laravel FormRequests and manual Blade forms?
- Scafera Form complements Laravel FormRequests and Blade rather than replacing Laravel validation. It is aimed at teams that want reusable, declarative form schemas instead of scattering rules and markup across requests and views. If you only need simple request validation, FormRequests plus Blade may be enough; choose scafera/form when form definitions, rendering, validation, and submission mapping should live together.