Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

livewire call function from other component

// component A
  public function functionCallComponentB(){
      $this->emit('callFunctionComponentB', 'optional_parameter');
  }

// component B
  public $listeners = [
      "callFunctionComponentB" => "functionReceiverCallFromComponentA"
  ];

  public function functionReceiverCallFromComponentA(){
      dd("called");
  }
 
PREVIOUS NEXT
Tagged: #livewire #call #function #component
ADD COMMENT
Topic
Name
3+8 =