From afdd92a0f293dc3c39fe4032e0135e594914ed70 Mon Sep 17 00:00:00 2001 From: Tb Fajri Date: Tue, 14 May 2024 14:01:21 +0700 Subject: [PATCH] update channel private --- Modules/Linksehat/Routes/api.php | 2 +- routes/channels.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Modules/Linksehat/Routes/api.php b/Modules/Linksehat/Routes/api.php index b84bfbba..c5c9582e 100644 --- a/Modules/Linksehat/Routes/api.php +++ b/Modules/Linksehat/Routes/api.php @@ -20,7 +20,6 @@ use Modules\Linksehat\Http\Middleware\Doctor\Authentication; use Modules\Linksehat\Http\Middleware\Doctor\Authorization; use Modules\Linksehat\Http\Controllers\Api\Doctor\AuthDoctorController; use Modules\Linksehat\Http\Controllers\Api\Doctor\ProfileDoctorController; - /* |-------------------------------------------------------------------------- | API Routes @@ -32,6 +31,7 @@ use Modules\Linksehat\Http\Controllers\Api\Doctor\ProfileDoctorController; | */ +Broadcast::routes(['middleware' => ['auth:sanctum']]); Route::prefix('linksehat')->group(function () { Route::get('dashboard/{query}/{limit?}', [DashboardController::class, 'index']); diff --git a/routes/channels.php b/routes/channels.php index 5d451e1f..7153b4f8 100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -13,6 +13,7 @@ use Illuminate\Support\Facades\Broadcast; | */ -Broadcast::channel('App.Models.User.{id}', function ($user, $id) { - return (int) $user->id === (int) $id; +Broadcast::channel('chat.{id}', function ($user, $id) { + // return (int) $user->id === (int) $id; + return true; });