From: Daniel Karbach Date: Fri, 11 Mar 2022 08:53:15 +0000 (+0100) Subject: add command to reload clients X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=2efd7613561696a3abb19ee9f42b15cf9b4058ad;p=alttp.git add command to reload clients --- diff --git a/app/Console/Commands/PleaseRefresh.php b/app/Console/Commands/PleaseRefresh.php new file mode 100644 index 0000000..7ebea1c --- /dev/null +++ b/app/Console/Commands/PleaseRefresh.php @@ -0,0 +1,33 @@ + { }; }, []); + useEffect(() => { + window.Echo.channel('App.Control') + .listen('PleaseRefresh', () => { + location.reload(); + }); + return () => { + window.Echo.leave('App.Control'); + }; + }, []); + return
diff --git a/resources/js/i18n/de.js b/resources/js/i18n/de.js index e31b96c..033059b 100644 --- a/resources/js/i18n/de.js +++ b/resources/js/i18n/de.js @@ -21,6 +21,7 @@ export default { }, rounds: { date: '{{ date, L }}', + empty: 'Noch keine Runde gestartet', heading: 'Runden', new: 'Neue Runde', }, diff --git a/routes/channels.php b/routes/channels.php index 5d451e1..4302bb7 100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -14,5 +14,9 @@ use Illuminate\Support\Facades\Broadcast; */ Broadcast::channel('App.Models.User.{id}', function ($user, $id) { - return (int) $user->id === (int) $id; + return (int) $user->id === (int) $id; +}); + +Broadcast::channel('App.Control', function ($user) { + return true; });