channels.php 584 B

1234567891011121314151617181920
  1. <?php
  2. declare(strict_types=1);
  3. use Illuminate\Support\Facades\Broadcast;
  4. /*
  5. |--------------------------------------------------------------------------
  6. | Broadcast Channels
  7. |--------------------------------------------------------------------------
  8. |
  9. | Here you may register all of the event broadcasting channels that your
  10. | application supports. The given channel authorization callbacks are
  11. | used to check if an authenticated user can listen to the channel.
  12. |
  13. */
  14. Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
  15. return (int) $user->id === (int) $id;
  16. });