Created
May 13, 2023 18:12
-
-
Save mansha99/7db2c08ed93781115d4d502419a5c387 to your computer and use it in GitHub Desktop.
Livewire components receiving Event
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Livewire; | |
use Livewire\Component; | |
class Receiver extends Component | |
{ | |
public $message="Received no event so far"; | |
public $timeStamp=''; | |
protected $listeners = ['timestamp-event' => 'timeStampEventListener']; | |
public function timeStampEventListener($timeStamp) | |
{ | |
$this->message=" Received ".'timestamp-event'.' event '; | |
$this->timeStamp=$timeStamp; | |
} | |
public function render() | |
{ | |
return view('livewire.receiver'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment