<?php

use Illuminate\Support\Facades\Broadcast;
use Rootsud\Core\Models\Billing_plan_payment;

/*
|--------------------------------------------------------------------------
| 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.
|
*/
// Broadcast::channel('users.{id}', function ($user, $id) {
// Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
// Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
Broadcast::channel('users.{id}', function ($user, $id) {
    return (int) $user->id === (int) $id;
});



// Broadcast::channel('.payment.created', function ($user) {
//     return true;
//     // return (int) $user->id === (int) $payment->user_id;
// });


// Broadcast::channel('payment', function ($user) {
//     return true;
//     // return (int) $user->id === (int) $payment->user_id;
// });

// Broadcast::channel('payment.{payment}', function ($user, Billing_plan_payment $payment) {
//     return true;
//     // return (int) $user->id === (int) $payment->user_id;
// });