🚀 Hostinger Optimized
🖥️ Server: LiteSpeed
💻 System: Linux s20058.bom1.stableserver.net 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64
👤 User: skhata (1324)
🐘 PHP: 8.4.20
🚫 Disabled: ✨ NONE

💻 Terminal

📁 /home/skhata/chandrasons.com/public
$

📄 channels.php

📁 Path: /home/skhata/new.chandrapharma.com/routes/channels.php
📊 Size: 1.38 KB
🔒 Perm: 0644
📝 MIME: text/x-php
<?php

use App\Modules\Vendor\Models\Vendor;
use Illuminate\Support\Facades\Broadcast;

/*
|--------------------------------------------------------------------------
| Broadcast Channel Routes — Phase 4
|--------------------------------------------------------------------------
| All private/presence channels must be authorized here.
| Public channels (prefixed with no auth) don't need entries.
*/

/**
 * User notification channel.
 * Each authenticated user listens on their own private channel.
 */
Broadcast::channel('App.Models.User.{id}', function ($user, int $id) {
    return (int) $user->id === $id;
});

/**
 * Per-vendor private channel.
 * Used for new order alerts, payout notifications, stock alerts.
 */
Broadcast::channel('vendor.{vendorId}', function ($user, int $vendorId) {
    $vendor = Vendor::find($vendorId);
    return $vendor && $vendor->user_id === $user->id;
});

/**
 * Admin-only broadcast channel.
 * Used for platform-wide alerts, new vendor registrations, disputes.
 */
Broadcast::channel('admin', function ($user) {
    return $user->hasRole(['SuperAdmin', 'Admin']);
});

/**
 * Order tracking channel — accessible by order owner.
 * UUID-based so it can't be guessed.
 */
Broadcast::channel('order.{uuid}', function ($user, string $uuid) {
    return \App\Modules\Order\Models\Order::where('uuid', $uuid)
        ->where('user_id', $user->id)
        ->exists();
});
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨