diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index ee67f7714..352cce44a 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -16,11 +16,6 @@ class BroadcastServiceProvider extends ServiceProvider { Broadcast::routes(); - /* - * Authenticate the user's personal channel... - */ - Broadcast::channel('App.User.{userId}', function ($user, $userId) { - return (int) $user->id === (int) $userId; - }); + require base_path('routes/channels.php'); } } diff --git a/config/app.php b/config/app.php index b3f0991aa..3036ac7cb 100644 --- a/config/app.php +++ b/config/app.php @@ -196,6 +196,7 @@ return [ 'Artisan' => Illuminate\Support\Facades\Artisan::class, 'Auth' => Illuminate\Support\Facades\Auth::class, 'Blade' => Illuminate\Support\Facades\Blade::class, + 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, 'Bus' => Illuminate\Support\Facades\Bus::class, 'Cache' => Illuminate\Support\Facades\Cache::class, 'Config' => Illuminate\Support\Facades\Config::class, diff --git a/routes/channels.php b/routes/channels.php new file mode 100644 index 000000000..f16a20b9b --- /dev/null +++ b/routes/channels.php @@ -0,0 +1,16 @@ +id === (int) $id; +});