2018-10-04 19:10:43 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| 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.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2024-07-30 01:28:15 +02:00
|
|
|
// Broadcast::channel('App.User.{id}', function ($user, $id) {
|
|
|
|
// nlog($id);
|
|
|
|
|
|
|
|
// return false;
|
|
|
|
// // return (int) $user->id === (int) $id;
|
|
|
|
// });
|
|
|
|
|
2024-09-20 18:35:53 +02:00
|
|
|
Broadcast::channel('company-{company_key}', function (\App\Models\User $user, string $company_key) {
|
2024-07-30 01:28:15 +02:00
|
|
|
return $user->company()->company_key === $company_key;
|
2024-09-18 18:10:47 +02:00
|
|
|
});
|