Listing columns
The column is not loaded into the listing table. Users can still enable it in the column chooser, and the field stays in the form.
Fields of type
editor, longeditor, password and json are hidden by default.Combine it with column_visible to show the column anyway, or with column_present to load the value for your own column component without showing the column.The column is removed from the listing and from the column chooser. The field stays in the form and its value is saved.
Hiding fields in the form
The field is rendered but hidden. Its current value is still submitted and saved, which makes it useful for values set by another field or by a custom component.
hideField is an alias.The opposite of
hideFromForm, mostly used with a condition: visibleFieldIf:type,company shows the field only for companies.Hides the field only when creating, or only when editing a record. The value is still submitted.
ifDoesntExists is an alias of hideOnUpdate.Hidden fields are still validated, so hideOnCreate|required cannot be submitted when creating a record.Removing fields from the form
The field is not rendered in the form. By default, any submitted value is ignored and its You can also use the
required rule is skipped.
Set the value in your code, for example in onCreate() or setAdminAttributes(), or add allowInput to accept a value submitted by your own component:removeField alias.A required column is created as NOT NULL. Give such a field a default, or set the value in a model event, otherwise creating a record fails.Removes the field from the form and from the listing. It is a shortcut for
hidden|removeFromForm.Like
invisible, and the column is also removed from the column chooser and from the search. Its value is not sent to the administration.
Use it for technical columns an administrator should never work with.Allows a submitted value to be processed even when the field has
removeFromForm, invisible or disabled.
Applies when creating and updating records. It does not render an input or submit a value automatically; your component must send it. Normal validation still applies.Readonly and disabled fields
Renders a readonly input. When a record is created the value is submitted, so a default value is saved. When a record is updated, a posted value is ignored.
Renders a disabled input. The posted value is ignored,
required is skipped and changes are not written into the history.Conditional parameters
ParametershideFromForm, visibleField, removeFromForm, invisible, inaccessible, inaccessible_column, readonly and disabled
accept a condition evaluated live in the form while the user edits it. Add one of the postfixes:
The first argument selects the value to compare:
Values
NULL (or an empty value), TRUE and FALSE are converted to null and booleans. id,NULL matches a record which is being created:
Permissions
With administrator groups enabled, parameters can depend on the permissions of the logged administrator. The first argument is the permission, the rest are parameters applied when the administrator has it (hasAccess) or does not have it (hasNotAccess).
- Super administrators have every permission, and every administrator has access when administrator groups are disabled.
- Without a logged administrator (console, migrations, frontend) there is no access, so
hasNotAccessparameters are applied. Do not change the database schema this way (locale,multiple,belongsTo). - Parameters written directly on the field win over the permission parameters.
Interface scoped parameters
Applies the parameter only in the administration, e.g. a field required in the admin form but optional in your frontend form validated by
Model::validator().Applies the parameter only outside the administration and console.
inFrontend:requiredApplies the parameter only in console commands, including
admin:migrate. For example required|inConsole:null keeps the column nullable while the admin form requires the value.max:255 for strings, win over scoped parameters.