From 9df814e5126185291cf9e1fa0a9de09777f4cc4f Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 5 Aug 2016 15:44:29 -0500 Subject: [PATCH] Tweak a few broadcasting configurations. --- app/Providers/BroadcastServiceProvider.php | 7 +++++-- config/broadcasting.php | 6 +++++- config/queue.php | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 5e5f9982..15b7e546 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -16,8 +16,11 @@ class BroadcastServiceProvider extends ServiceProvider { Broadcast::routes(); - Broadcast::auth('example.*', function ($user, $exampleId) { - return true; + /** + * Authenticate the user's personal channel... + */ + Broadcast::auth('App.User.*', function ($user, $userId) { + return (int) $user->id === (int) $userId; }); } } diff --git a/config/broadcasting.php b/config/broadcasting.php index bf8b2dfe..bda73b1a 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -11,7 +11,7 @@ return [ | framework when an event needs to be broadcast. You may set this to | any of the connections defined in the "connections" array below. | - | Supported: "pusher", "redis", "log" + | Supported: "pusher", "redis", "log", "null" | */ @@ -49,6 +49,10 @@ return [ 'driver' => 'log', ], + 'null' => [ + 'driver' => 'null', + ], + ], ]; diff --git a/config/queue.php b/config/queue.php index 605142d4..549322ed 100644 --- a/config/queue.php +++ b/config/queue.php @@ -11,7 +11,7 @@ return [ | API, giving you convenient access to each back-end using the same | syntax for each one. Here you may set the default queue driver. | - | Supported: "null", "sync", "database", "beanstalkd", "sqs", "redis" + | Supported: "sync", "database", "beanstalkd", "sqs", "redis", "null" | */