TALL-forms
  • TALL-forms
  • Installation
    • Quickstart: Artisan cmd
    • Manual installation
      • Package
      • Translations
      • Css & Theme
      • Javascript
      • Tailwind
      • Laravel Mix
      • Wrapper view
      • Laravel Jetstream/Breeze
  • Upgrade v7 to v8
    • Configuration changes
    • Component & Field changes
    • Blade view changes
    • Notification changes
    • Styling changes
  • Concept
    • Configuration
    • Validation
    • Styling
    • Icons
    • Javascript
    • Layout vs Wrapper
    • Model binding
    • Manually saving data
    • Extend Blade Components
  • Create Forms
    • Form Data
    • Form Types
      • Standard form
      • As modal
      • Without buttons
      • Fields only
      • Headless
    • Form attributes
    • Form buttons
    • Form slots
    • Form methods
    • Lifecycle hooks
    • Render a form
    • Mass generate
  • Fields
    • Declaration
    • Labels
    • Field Slots
    • Field methods
    • Custom field attributes
    • Conditional field
    • Custom view
    • Custom field
    • Custom Livewire component
    • Relations
    • Fields
      • Checkbox
      • Checkboxes
      • FileUpload
      • Honeypot
      • ImageCropper
      • Input
      • Password
      • InputArray
      • KeyVal (array)
      • Radio
      • Range
      • Repeater (array)
      • Search
      • Select & Multiselect
      • Tags
      • TagsSearch
      • Textarea
      • Trix
      • SpatieTags
    • Sponsor Fields
      • More Inputs
      • CKEditor
      • DatePicker
      • Heading
      • Markdown
      • Panels
      • SearchList
      • SelectOptGroup
      • Tabs
      • Trix, file-uploads
  • Blade components
    • Notifications
    • Label wrapper
    • Button
    • Modal blade component
    • Modal form blade component
  • Examples
    • Input examples
    • Array fields example
Powered by GitBook
On this page

Was this helpful?

  1. Fields

Custom Livewire component

PreviousCustom fieldNextRelations

Last updated 3 years ago

Was this helpful?

Please read the page. It is recommended that you create a Custom Field instead of using this method because Livewire doesn't handle nested components very well.

livewireComponent(string $component, array $params = [])

  • Replace the field with your own Livewire component.

  • $component = String, the path and name (as path.name) to a Livewire component

  • $params = Optional array with parameters to pass to the child component.

custom() or emitUp()

In this example we are using the custom() method to tell the component that we want to handle this field manually. (). Another option could be to do emitUp() () in the child component to populate the field in the main form component.

Example

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"
        ]),

Custom Field
see manually saving data
see Livewire docs