chore: cleanup project structure and update readme for beta release

This commit is contained in:
2025-12-23 04:59:21 +07:00
parent 1640ced748
commit 10a00bac0e
122 changed files with 8320 additions and 661 deletions

23
routes/channels.php Normal file
View File

@@ -0,0 +1,23 @@
<?php
use Illuminate\Support\Facades\Broadcast;
Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
return $user->id === $id;
});
Broadcast::channel('user.{id}', function ($user, $id) {
return (int) $user->id === (int) $id;
});
Broadcast::channel('ticket.{ticketId}', function ($user, $ticketId) {
// Ensure we convert ticketId to string if it's not already
$ticket = \App\Models\Ticket::where('id', (string) $ticketId)->first();
if (!$ticket) {
return false;
}
// Allow owner or admin
return (string) $user->id === (string) $ticket->user_id || $user->isAdmin();
});