From 5637345eb0fa194cd4398016d2d2c7b8ffd76c94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Wis=CC=81niewski?= Date: Thu, 2 Apr 2026 15:18:32 +0200 Subject: [PATCH 1/2] Added webinar channel --- src/Broadcasting/WebinarChannel.php | 14 ++++++++++++++ src/EscolaLmsWebinarServiceProvider.php | 1 + src/channels.php | 3 +++ 3 files changed, 18 insertions(+) create mode 100644 src/Broadcasting/WebinarChannel.php create mode 100644 src/channels.php diff --git a/src/Broadcasting/WebinarChannel.php b/src/Broadcasting/WebinarChannel.php new file mode 100644 index 0000000..1929ad6 --- /dev/null +++ b/src/Broadcasting/WebinarChannel.php @@ -0,0 +1,14 @@ +trainers()->where('users.id', '=', $user->getKey())->exists(); + } +} diff --git a/src/EscolaLmsWebinarServiceProvider.php b/src/EscolaLmsWebinarServiceProvider.php index 327ee32..b4baa2c 100644 --- a/src/EscolaLmsWebinarServiceProvider.php +++ b/src/EscolaLmsWebinarServiceProvider.php @@ -34,6 +34,7 @@ public function boot() $this->loadRoutesFrom(__DIR__ . '/routes.php'); $this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'webinar'); + $this->loadRoutesFrom(__DIR__ . '/channels.php'); if ($this->app->runningInConsole()) { $this->bootForConsole(); diff --git a/src/channels.php b/src/channels.php new file mode 100644 index 0000000..6330e5b --- /dev/null +++ b/src/channels.php @@ -0,0 +1,3 @@ + 'auth:api']); From cf6d3b2af523260bf8376ffb581b64555f705890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Witold=20Wis=CC=81niewski?= Date: Thu, 2 Apr 2026 15:20:32 +0200 Subject: [PATCH 2/2] Fix --- src/channels.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/channels.php b/src/channels.php index 6330e5b..0c78177 100644 --- a/src/channels.php +++ b/src/channels.php @@ -1,3 +1,6 @@ 'auth:api']); +use EscolaLms\Webinar\Broadcasting\WebinarChannel; +use Illuminate\Support\Facades\Broadcast; + +Broadcast::channel('webinar.{webinar}.{term}', WebinarChannel::class, ['middleware' => 'auth:api']);