Pony.fm/app/Providers/BroadcastServiceProvider.php

27 lines
550 B
PHP
Raw Normal View History

<?php
2021-02-14 03:34:58 +01:00
namespace App\Providers;
use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\ServiceProvider;
class BroadcastServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Broadcast::routes();
/*
* Authenticate the user's personal channel...
*/
2017-11-28 06:44:31 +01:00
Broadcast::channel('App.User.{userId}', function ($user, $userId) {
return (int) $user->id === (int) $userId;
});
}
}