- What does the forms-for-laravel package do?
- Forms for Laravel lets you manage form structures, fields, and submissions in the database. You define forms in code with a fluent API, render them in Blade, and handle validation and submissions cleanly. It is intentionally lightweight and does not include extra admin tooling.
- How do I install roundly-consulting/forms-for-laravel?
- Install it with Composer using composer require roundly-consulting/forms-for-laravel. Then publish and run any package migrations or configuration the package provides, and clear cached config. Check the package composer.json for Laravel and PHP version constraints before installing.
- How do I define a form using the fluent API?
- You build a form structure in code by chaining field definitions through the package fluent API. The resulting form structure and its fields are persisted in the database so they can be rendered and processed later. This keeps form definitions versionable in your application code instead of requiring an admin UI.
- How do I render a form in Blade?
- The package is designed to render stored form structures directly in Blade templates. You pass the form or its fields to the Blade view and let the package output the appropriate markup. Review the package README for the exact Blade directives or view components it exposes.
- How are validation and submissions handled?
- Validation rules are defined alongside the form fields and applied when a submission is processed. Valid submissions are stored in the database through the package submission model. Invalid input is handled through Laravel standard validation flow so you can display errors in your views.
- Can I swap in my own custom form or submission models?
- Yes, the package uses configurable model resolution so a host application can replace the default models. Release 1.0.4 fixes the factories so they build the configured model when the host app swaps it. You should still verify that custom factory states and relationships work with your swapped models.
- Which Laravel and PHP versions does forms-for-laravel support?
- The provided release information does not publish explicit Laravel or PHP version support. Check the package composer.json constraints and test against your target Laravel and PHP versions before upgrading. If you rely on model swapping, include that scenario in your compatibility testing.
- Are the package factories usable in host-app tests and seeders?
- Yes, the factories are intended for Laravel factory workflows, including host-app tests and seeders. Release 1.0.4 improves reliability when the host application swaps package models. Add a regression test that exercises a host-swapped model so future upgrades do not silently break test data generation.
- What should I check before using it in production?
- Run the package migrations, clear cached configuration after deployment, and confirm that submission storage works as expected. Factories and seeders are mainly test and development concerns, so production runtime impact is minimal. Pin the package version and review changelogs for factory or model-resolution changes.
- How is the package maintained and how should I upgrade?
- Release 1.0.4 is a patch-level factory fix with no indicated breaking changes, so maintenance overhead is low. Upgrade within the 1.0.x line using Composer update, clear cached config, and run your test suite, especially tests that use package factories. Pin the version and review future changelogs for model-resolution changes.