Fields

Hidden

Basics

Contains all Basic methods.

The Hidden field is a hidden field. This field is equivalent to type=hidden.

The field will be hidden during form building, but will be displayed in the preview, as will its wrapper.

use MoonShine\UI\Fields\Hidden;
 
Hidden::make('category_id')
<x-moonshine::form.input
type="hidden"
name="hidden_id"
/>

Show Value

The field is completely hidden in the form, but if you need to maintain the field's behavior while displaying its value, you can use the showValue method:

Hidden::make('category_id')->showValue()