- What is fourstacks/nova-repeatable-fields used for?
- It is a Laravel Nova field package that lets editors add, remove, and reorder rows of a reusable field set inside resource forms, with each repeated group stored as JSON on the parent model. It suits form-shaped content such as FAQs, feature lists, opening hours, or contact details. It only applies to Nova resources, so it does nothing in a plain Laravel application without Nova.
- How do I install fourstacks/nova-repeatable-fields?
- Install it with Composer as fourstacks/nova-repeatable-fields; because the package is archived, pin an exact version such as 1.3.0 rather than floating the constraint. Then add a nullable JSON column to the target model, cast it to array, and register the field in the Nova resource. Installation itself is quick, but the real work is the validation, normalization, and testing you build around it.
- Does fourstacks/nova-repeatable-fields support Laravel Nova 4 and recent Laravel versions?
- There is no released support for recent Nova or Laravel majors: the last release was 2019-06-10 and the repository is archived. Nova majors are breaking changes, and this field class plus its Vue component has not tracked them, so expect incompatibility with newer Nova APIs unless you fork and update it. Check the Composer constraint and test on your exact Nova version before committing.
- How is repeatable data stored, and do I need a migration?
- Yes, you need a migration. Each repeatable set is serialized as JSON into a single column on the parent model, usually a nullable json column you add yourself. You then add that column to the model's casts as an array so Nova can read and write it. This keeps schema changes simple but makes the data hard to query across records.
- How do I define a repeatable field set in a Nova resource?
- You add the package's repeatable field class to the resource's fields method and give the group a name plus a set of nested Nova fields that define one row. The same definition renders every row, and editors can add, remove, and reorder instances in the form. The API is intentionally small, so the parent model just needs the matching JSON column and array cast.
- How do I validate rows inside a repeatable field group?
- The package does not validate the whole repeatable payload for you, so add wildcard rules on the parent model or in the Nova request, for example required rules per subfield key per index. Also enforce a maximum row count yourself, since there is no built-in row cap. Normalizing the payload with array_values before saving avoids JSON object versus array surprises.
- Which Nova field types work inside a repeatable group?
- The package renders standard Nova field types inside each group, but its coverage is a fixed set in the Vue component rather than being fully generic. Relationship fields such as BelongsTo, File or Image fields, and async or modal-based fields typically do not work reliably. Test every field type you intend to use before shipping the form.
- Is fourstacks/nova-repeatable-fields still maintained and safe for production?
- It is effectively unmaintained: the repository is archived, the last release was June 2019, and it has zero dependents on Packagist. That means there is no upstream fix path for new Nova releases, browser changes, or Vue upgrades, so treat any use as a fork you own and maintain. For low-traffic, admin-facing forms on a pinned Nova version it can still be acceptable, but do not assume it will survive a Nova upgrade.
- Should I use a JSON repeater field or a relational child table instead?
- Use a repeatable JSON field when the content is form-shaped, edited only in the admin, and never queried across records, such as FAQs or opening hours. If you need to search, aggregate, export, or report on individual rows, use a child table with a relation instead, because querying JSON paths is painful and only tolerable with generated columns. Before adopting this package, also check whether your Nova major ships a native repeater or a maintained community field that already covers the use case.
- How do I test the add, remove, and reorder interactions?
- Those interactions happen in the Vue component, so HTTP or feature tests will not exercise them. Write browser tests with Laravel Dusk that click add, fill a row, remove it, and reorder rows, then assert the saved JSON on the model. Also unit test your saving normalizer and wildcard validation rules, since those are the parts most likely to break.