diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 0a22a5af2..1670987c1 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -7,7 +7,6 @@ use Illuminate\Support\ServiceProvider; class BroadcastServiceProvider extends ServiceProvider { - /** * Bootstrap any application services. * @@ -17,14 +16,6 @@ class BroadcastServiceProvider extends ServiceProvider { Broadcast::routes(); - /* - * Authenticate the user's personal channel... - */ - Broadcast::channel( - 'App.User.*', - function ($user, $userId) { - return (int)$user->id === (int)$userId; - } - ); + require base_path('routes/channels.php'); } -} +} \ No newline at end of file diff --git a/config/app.php b/config/app.php index fdf1db757..669168482 100644 --- a/config/app.php +++ b/config/app.php @@ -204,7 +204,7 @@ return [ */ App\Providers\AppServiceProvider::class, App\Providers\AuthServiceProvider::class, - // App\Providers\BroadcastServiceProvider::class, + App\Providers\BroadcastServiceProvider::class, App\Providers\EventServiceProvider::class, App\Providers\RouteServiceProvider::class, diff --git a/config/broadcasting.php b/config/broadcasting.php index 19a59bad9..0b54e0b37 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -15,7 +15,7 @@ return [ | */ - 'default' => env('BROADCAST_DRIVER', 'null'), + 'default' => env('BROADCAST_DRIVER', 'pusher'), /* |-------------------------------------------------------------------------- @@ -32,11 +32,19 @@ return [ 'pusher' => [ 'driver' => 'pusher', - 'key' => env('PUSHER_KEY'), - 'secret' => env('PUSHER_SECRET'), - 'app_id' => env('PUSHER_APP_ID'), + 'key' => env('PUSHER_APP_KEY', 12345), + 'secret' => env('PUSHER_APP_SECRET', 12345), + 'app_id' => env('PUSHER_APP_ID', 12345), 'options' => [ - // + 'cluster' => env('PUSHER_APP_CLUSTER', 'mt1'), + 'encrypted' => env('BROADCAST_SSL', false), + 'host' => '127.0.0.1', + 'port' => 6001, + 'scheme' => env('BROADCAST_SSL', false) ? 'https' : 'http', + 'curl_options' => [ + CURLOPT_SSL_VERIFYHOST => 0, + CURLOPT_SSL_VERIFYPEER => 0, + ] ], ], diff --git a/routes/channels.php b/routes/channels.php new file mode 100644 index 000000000..5d451e1fa --- /dev/null +++ b/routes/channels.php @@ -0,0 +1,18 @@ +id === (int) $id; +});