-
Notifications
You must be signed in to change notification settings - Fork 0
input default
Every input requires some settings. Some are required to make the system work, others are optional. Example:
'title' => [
'type' => 'text',
'label' => trans('hack::modules.pages.title'),
'regex' => '',
'overview' => false,
],
Key | Type | Default | Required |
---|---|---|---|
type | string | null | yes |
label | string | null | yes |
regex | string | null | yes |
values | string or array | null | yes |
default | string | '' | no |
overview | boolean | true | no |
create | boolean | true | no |
edit | boolean | true | no |
save | boolean | true | no |
This is the name of the blade in the resources/inputs/[action]/[type]
folder.
This is the label for the page field.
You should use the Laravel validation rules. If used as is, the rules will apply to the create and the update actions. But it is also possible to make an array of it to have different rules for create and update:
'regex' => [
'create' => '',
'edit' => '',
]
The values field can either require only a string, a string reference to a function or an array. It can never be a nameless function. Depending on the type of input it requires a string or array.
The default value for the input
Show this value on the overview table or not
Show on create or not
Show on edit or not
Show it, but don't save it. This is usually used for helper fields that have no database record.