Skip to content

Form model binding and old input #9

Closed

Description

@n4ff4h

Keep and verify model binding (<Form model={user}>), nested and array names (address[city], tags[]), and old input precedence, matching javaabu/forms v2. Document any intentional differences in docs/migrating-from-blade.md.

Activity

  1. added
    next-genNext-gen Javaabu packages
    featurePackage feature from the spec
    on Nov 4, 2026
  2. added a commit that references this issue on Nov 4, 2026
    c0bac9c
  3. n4ff4h commented on Nov 4, 2026

    @n4ff4h
    CollaboratorAuthor

    Verified on next-gen (c0bac9c) against javaabu/forms HandlesDefaultAndOldValue, Select, Checkbox and Radio. src/core/binding.test.tsx has 16 cases.

    The precedence matches Blade:

    • old input, then the bound value (data_get), then default
    • Laravel's old($key, $default) returns a null old value when the key exists, and so does React
    • Select uses old input, then default, then the bound value
    • checkboxes follow only old input once there is any

    Intentional differences, listed in docs/migrating-from-blade.md:

    • Radios are selected when the bound value equals their value. Blade checks every radio of a group on a truthy scalar.
    • Grouped checkboxes get unique ids.
    • Multi-selects always submit name[].

    Docs: docs/basic-usage/model-binding.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurePackage feature from the specnext-genNext-gen Javaabu packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions