-
-
Notifications
You must be signed in to change notification settings - Fork 86
BaseField Slots
tanthammar edited this page Nov 18, 2020
·
3 revisions
Example
Input::make('Label')
->before('Before')
->after('After')
->above('Above')
->below('Below')
->help('Some help text')
->icon('file-user'), //requires blade ui kit icons
Sets the help text to use below the field. $help
= The help text.
Input::make('City')->required()->help('Please enter your current city.'),
- Display a custom view instead of the default field view
- The view will have access to
$field
,$form_data
, and$model
variables, as well as any other public component properties. @param string $blade_view_to_include
Input::make('Custom Field')->view('fields.custom-field');
- Used only in inline form
- Default sm:w-1/3
- useful if you want to append (*) to the label on required fields
Input::make('Label')
->afterLabel('After label')
->labelSuffix('suffix')
->rules('required|string'),
Please read the Custom Field page.
It is recommended that you create a Custom Field
instead of using this method.
- Replace this field with your own livewire component.
- You can use a Livewire component as custom view for a field.
-
$component
= String, the path and name (aspath.name
) to a livewire component -
$params
= Optional array with parameters to pass to the child component.
In this example we are using the custom()
method to tell the component that we want to handle this field manually. (see docs for custom field). Another option could be to do emitUp()
(see Livewire docs) in the child component to populate the field in the main form component.
The example is for a fictive Livewire/App/Tags
component with three properties.
Input::make('Tags')
->custom()
->livewireComponent("app.tags",
[
'model' => $this->model,
'tagType' => "event",
'setLocale' => "sv"
]),
- Installation
- Requirements
- v5 Upgrade Guide
- v6 Upgrade Guide
- v7 Upgrade Guide
- Support
- Quickstart
- Manual installation
- Optional
- Form component
- Field
- Field types
- Example Form
- Blade Components
- Notifications