Version 5.3 of Laravel has some news, such as Broadcasting , for example.
I read the documentation, but I could not quite understand it.
I have seen that it has some relation (if direct or indirect, I do not know) with the Websockets. I also saw that in the routes
folder, there is a file named channels.php
, where there is a sample code:
Broadcast::channel('App.User.{id}', function ($user, $id) {
return (int) $user->id === (int) $id;
});
I wanted to know more deeply:
-
What is this broadcasting about in Laravel?
-
In what situations can I use it, for example?
-
What is the relationship between Laravel's Broadcasting and Websockets?
The question is intended to have the content in the Portuguese language, due to not finding anything on the internet in our language