Answer the question
In order to leave comments, you need to log in
How to fix Malformed UTF-8 characters, possibly incorrectly encoded error when passing data to Laravel event?
There is the following code, the purpose of which is to pass data to the event.
$result = Message::create($request->all());
event(new \App\Events\StrangeEvent($result));
class StrangeEvent implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $message;
public function __construct($messages)
{
$this->message = $messages;
}
public function broadcastOn()
{
return ['channel'];
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question