Basic Usage
Attributes
The name attribute for the input field.
The label text displayed above the input. If empty, a label will be auto-generated from the name.
The Eloquent model instance to bind the input to. When provided, the component will automatically populate the value from the model.
Default value for the input when no model or old value exists.
Custom date format for displaying the value. When empty, uses default formatting. Accepts PHP date format strings (e.g.,
Y-m-d, d/m/Y, m/d/Y).Custom icon class for the calendar icon. Defaults to framework-configured icon:
- Bootstrap 5:
fa-regular fa-calendar - Material Admin 26:
zmdi zmdi-calendar
Custom icon class for the clear button. Defaults to framework-configured icon:
- Bootstrap 5:
fa-regular fa-close - Material Admin 26:
zmdi zmdi-close
Custom CSS classes for the clear button. Defaults to framework-configured classes:
- Bootstrap 5:
btn btn-outline-secondary btn-date-clear disable-w-input - Material Admin 26:
text-body btn-date-clear disable-w-input
CSS classes for the icon wrapper element. Defaults to
date-icon-wrapper.Display validation errors below the input.
Show or hide the label element.
Placeholder text for the input. Auto-generated from label if
showPlaceholder is true.Automatically generate placeholder from label.
Mark the field as required with an asterisk in the label.
Render the input in horizontal/inline layout.
Use Bootstrap floating label style.
Custom CSS classes for inline label. Defaults to framework configuration.
Custom CSS classes for inline input wrapper. Defaults to framework configuration.
Enable JavaScript validation error display.
Override the default CSS framework. Options:
bootstrap-5, material-admin-26.Examples
Basic Date Input
With Model Binding
Custom Date Format
With Custom Icons
Inline Layout
Floating Label
With Placeholder
With Default Value
With Additional Attributes
Configuration
The Date component uses configuration fromconfig/forms.php:
Eloquent Date Casting
Framework Icon Settings
Implementation Details
The Date component:- Renders with the
date-pickerCSS class for JavaScript initialization - Displays a calendar icon in an input group prepend
- Includes a clear button to reset the date value
- Supports date formatting via the
dateFormatattribute - Extends the base Input component functionality
- Automatically handles Eloquent model date casting when configured
src/Views/Components/Date.php:9
View: resources/views/bootstrap-5/input.blade.php:6