File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -186,8 +186,47 @@ $field = Checkbox::make(__('Categories'), 'categories')
186186
187187### Color
188188
189+ The ` Color ` field is typically a handler for ` color ` model attributes:
190+
191+ ``` php
192+ $field = Color::make(__('Background Color'), 'bg_color');
193+ ```
194+
195+ > You may use the ` hex_color ` validation rule for this field. By default no rules attached.
196+
189197### Date
190198
199+ The ` Date ` field is typically a handler for ` date ` or ` datetime ` model attributes:
200+
201+ ``` php
202+ $field = Date::make(__('Expires at'), 'expires_at');
203+ ```
204+
205+ > You may use the ` date ` validation rule for this field. By default no rules attached.
206+
207+ You can also apply modifiers on a ` Date ` field:
208+
209+ ``` php
210+ // Adds/removes a time handler for the field
211+ $field->withTime();
212+ $field->withTime(false);
213+
214+ // Sets the displayed timezone for the input
215+ // Note, the value is saved to the database in the app's timezone (normally UTC)
216+ $field->timezone('Europe/Budapest');
217+
218+ // Adds the "step" HTML input attribute
219+ $field->step(1);
220+
221+ // Adds the "min" HTML input attribute
222+ $field->min('2024-01-01');
223+ $field->min(now()->addDays(7));
224+
225+ // Adds the "max" HTML input attribute
226+ $field->max('2024-01-01');
227+ $field->max(now()->addDays(7));
228+ ```
229+
191230### Editor
192231
193232### File
You can’t perform that action at this time.
0 commit comments