Initial commit
This commit is contained in:
20
resources/views/test/broadcast.blade.php
Normal file
20
resources/views/test/broadcast.blade.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
Dispatch 'php artisan user:lang' command to execute Test_UserLangChangedEvent, that will be broadcasts on private channel 'change-lang.{{ $toUserId }}':<br>{{ $user->name }}'s locale setting is <strong id="lang">{{ $user->locale }}.</strong><br/>
|
||||
</div>
|
||||
|
||||
<script src="{{ mix('js/app.js') }}"></script>
|
||||
|
||||
<script>
|
||||
window.Pusher.logToConsole = true;
|
||||
window.Echo.private('change-lang.{{ $toUserId }}')
|
||||
.listen('Test_UserLangChangedEvent', (e) => {
|
||||
window.location.reload();
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user