---
title: "Editing forms — Forms for Laravel | Roundly"
description: "Diff a new definition against the stored structure and save only what changed — events fire only for changed records."
url: https://roundly-consulting.com/open-source/docs/forms-for-laravel/editing-forms
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Forms for Laravel](https://roundly-consulting.com/open-source/docs/forms-for-laravel.md)

# 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:

```php
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](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## 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.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/forms-for-laravel.md)
