Skip to content

Instantly share code, notes, and snippets.

@Ghostscypher
Created September 7, 2021 13:33
Show Gist options
  • Save Ghostscypher/aaa02cb0786b53890c6b090e9f5959ee to your computer and use it in GitHub Desktop.
Save Ghostscypher/aaa02cb0786b53890c6b090e9f5959ee to your computer and use it in GitHub Desktop.
<?php
use Illuminate\Support\Facades\Broadcast;
/*
|--------------------------------------------------------------------------
| Broadcast Channels
|--------------------------------------------------------------------------
|
| Here you may register all of the event broadcasting channels that your
| application supports. The given channel authorization callbacks are
| used to check if an authenticated user can listen to the channel.
|
*/
// We are prefixing the channel name in this case app.name returns the channel name
Broadcast::channel(config('app.name') . '.{id}', function ($user, $id) {
return (int) $user->id === (int) $id;
});
Broadcast::channel(config('app.name') . '.Public', function (){
return true;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment