From b4110d9d88c28c0f162aeb07a3901c25aed040d8 Mon Sep 17 00:00:00 2001 From: raccoon254 Date: Sun, 19 May 2024 15:08:18 +0300 Subject: [PATCH] Receive messages from the current message component --- app/Livewire/DisplayChatMessage.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Livewire/DisplayChatMessage.php b/app/Livewire/DisplayChatMessage.php index c2dbaa3..7dfbb8b 100644 --- a/app/Livewire/DisplayChatMessage.php +++ b/app/Livewire/DisplayChatMessage.php @@ -2,11 +2,20 @@ namespace App\Livewire; +use App\Models\Message; +use Illuminate\View\View; use Livewire\Component; class DisplayChatMessage extends Component { - public function render() + public Message $message; + + public function mount(Message $message): void + { + $this->message = $message; + } + + public function render(): View { return view('livewire.display-chat-message'); }