openstamanager/routes/channels.php

19 lines
591 B
PHP
Raw Normal View History

2021-07-30 18:38:43 +02:00
<?php
use App\Models\User;
2021-07-30 18:38:43 +02:00
use Illuminate\Support\Facades\Broadcast;
/*
|--------------------------------------------------------------------------
| Broadcast Channels
|--------------------------------------------------------------------------
|
| Here you may register all the event broadcasting channels that your
2021-07-30 18:38:43 +02:00
| application supports. The given channel authorization callbacks are
| used to check if an authenticated user can listen to the channel.
*/
Broadcast::channel('App.Models.User.{id}', static function (User $user, string|int $id) {
return $user->id === (int) $id;
2021-07-30 18:38:43 +02:00
});