filament icon indicating copy to clipboard operation
filament copied to clipboard

Hidden fields are not working in repeater and builder

Open indigoram89 opened this issue 2 months ago • 2 comments

Package

filament/filament

Package Version

v4.1.10

Laravel Version

v12.36.1

Livewire Version

v3.6.4

PHP Version

PHP 8.4.12

Problem description

The hidden fields in repeater and builder do not save their value to database, and an empty div is displayed in the html of the page.

Expected behavior

The values of the hidden fields should be saved as usual.

Steps to reproduce

  1. Create a repeater with a hidden field.
  2. Add the item to repeat.
  3. Save and check the database.

The values from the hidden field will not be in the database.

Reproduction repository (issue will be closed if this is not valid)

https://github.com/indigoram89/filament-repeater-hidden-field

Relevant log output


indigoram89 avatar Oct 31 '25 11:10 indigoram89

@indigoram89 Based on a Discord message from a Filament core team member:

->hidden() removes the field completely from the form. Whereas a Hidden::make() will create a hidden input. But seeing as this has to do with cost it is best to handle this as Leandro suggested on the backend. Hidden inputs can be manipulated on the front end.

This message is 2 years old but I check and ->hidden() indeed disables the rendering of the DOM element while the Hidden component simply renders and hides the field. Strange though how this is not mentioned in the documentation (or at least I can't find anything about it).

balintcodes avatar Nov 01 '25 19:11 balintcodes

@balintcodes thank you so much! it is so and I also found Hidden field later.

indigoram89 avatar Nov 03 '25 14:11 indigoram89