Created
May 13, 2023 18:05
-
-
Save mansha99/7472949676e33b5c0de4c24500d480bc to your computer and use it in GitHub Desktop.
A Laravel Livewire component acting as publisher (Generator) of event
This file contains hidden or 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 Sender extends Component | |
{ | |
public function fireTimestampEvent() | |
{ | |
$this->emit('timestamp-event', 'Timestamp is '.date('h:i:s')); | |
} | |
public function render() | |
{ | |
return view('livewire.sender'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment