NewWe open-sourced 50+ Laravel packages
Custom AI apps, agents and automation — Roundly ConsultingRoundly
All packages
Forms for Laravel

Editing forms

Forms::update($key) returns a builder that diffs your definition against the persisted structure and saves the changes in a transaction — adding new groups and fields, renaming or reordering existing ones, and firing the FormUpdated / Group* / Field* events only for records that actually changed. Records absent from the definition are left untouched:

Forms::update('contact')
    ->name('Contact us')
    ->public()
    ->group('details', 'Your details', function (GroupBuilder $g): void {
        $g->field('name', 'Full name')->rules(['required']);
        $g->field('phone', 'Phone'); // added
    })
    ->save();
  • Groups and fields are matched by key; a key that doesn’t exist yet is created.
  • name(), public(bool) and expiresAt() are optional — anything you don’t set keeps its stored value.
  • Fields are compared on name, type, help, autofill, options, validations, conditions, messages and order.
  • Nothing is deleted — to remove a group or field, soft-delete its model.
  • An unknown key throws FormNotFoundException.

Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

More ways to support, including crypto

By donating, you agree to our donation terms.

Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.