Skip to content

Instantly share code, notes, and snippets.

@mansha99
Created May 13, 2023 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mansha99/7db2c08ed93781115d4d502419a5c387 to your computer and use it in GitHub Desktop.
Save mansha99/7db2c08ed93781115d4d502419a5c387 to your computer and use it in GitHub Desktop.
Livewire components receiving Event
<?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