karnoweb / laravel-ticket-chat
A comprehensive ticketing and messaging system for Laravel applications
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/karnoweb/laravel-ticket-chat
Requires
- php: ^8.2
- illuminate/broadcasting: ^10.0|^11.0|^12.0
- illuminate/database: ^10.0|^11.0|^12.0
- illuminate/notifications: ^10.0|^11.0|^12.0
- illuminate/support: ^10.0|^11.0|^12.0
Requires (Dev)
- laravel/pint: ^1.0
- orchestra/testbench: ^8.0|^9.0|^10.0
- pestphp/pest: ^2.0
- phpstan/phpstan: ^1.10
README
A powerful ticketing and messaging system for Laravel applications.
Features
- Ticket System – Support ticket management with status, priority, departments
- Direct Messages – One-on-one conversations
- Group Chat – Multi-user conversations
- Channels – Broadcast-style channels
- Departments – Organize tickets by department with agents
- Attachments – File upload support
- Real-time – Broadcasting (Reverb/Pusher) support
- SLA – Service level agreements (optional)
- CSAT – Customer satisfaction ratings
- Tags – Label and organize tickets
- Canned Responses – Pre-defined reply templates
- Internal Notes – Private agent notes
Requirements
- PHP 8.2+
- Laravel 10.x or 11.x
Installation
composer require karnoweb/laravel-ticket-chat
Run the install command:
php artisan ticket-chat:install
Or manually:
php artisan vendor:publish --tag=ticket-chat-config php artisan vendor:publish --tag=ticket-chat-migrations php artisan migrate
Configuration
Add the traits to your User model:
<?php namespace App\Models; use Illuminate\Foundation\Auth\User as Authenticatable; use Karnoweb\TicketChat\Traits\HasTickets; use Karnoweb\TicketChat\Traits\HasConversations; use Karnoweb\TicketChat\Traits\CanBeDepartmentAgent; class User extends Authenticatable { use HasTickets, HasConversations, CanBeDepartmentAgent; }
Usage
Create a ticket
use Karnoweb\TicketChat\Facades\Ticket; $ticket = Ticket::create([ 'title' => 'Need help', 'description' => 'Description here', 'created_by' => auth()->id(), 'department_id' => 1, 'priority' => 'high', 'branch_id' => 1, // optional (v2 multi-branch) ]);
Multi-branch support (v2)
When features.multi_branch is enabled, you can scope tickets and conversations by branch:
- Creating: Pass
branch_idin the ticket data array, or as the last argument toChat::directTo(),Chat::createGroup(), andChat::createChannel(). - Listing: Use the optional
$branchIdparameter onTicket::forUser(),Ticket::forAgent(),Ticket::forDepartment(),Ticket::findByTicketNumber(),Chat::getConversationsForUser(), andChat::getChannelsForUser(). - Unread count:
Ticket::unreadCount($userId, null, $branchId)andChat::unreadCount($userId, null, $branchId)restrict the count to conversations in that branch.
If branch_id / $branchId is omitted, behaviour is unchanged (all data).
Default branch: When general.default_branch_id is set (e.g. via TICKET_CHAT_DEFAULT_BRANCH_ID), all creates and reads use that branch automatically when no branch is passed. Set it in config/ticket-chat.php or your .env to always scope to one branch without passing $branchId everywhere.
Reply to a ticket
Ticket::reply($ticket, auth()->id(), 'Your message here');
Direct message
use Karnoweb\TicketChat\Facades\Chat; $conversation = Chat::directTo(auth()->id(), $otherUserId, 'Hello!');
Send message
Chat::sendMessage($conversation, auth()->id(), 'Message text');
Artisan Commands
php artisan ticket-chat:install– Install the packagephp artisan ticket-chat:auto-close– Auto-close inactive ticketsphp artisan ticket-chat:cleanup-attachments– Clean old/orphaned attachmentsphp artisan ticket-chat:sla-warnings– Send SLA breach warnings
Documentation
مستندات کامل استفاده (فارسی) در فایل docs/USAGE.md قرار دارد و شامل موارد زیر است:
- نصب و راهاندازی
- پیکربندی کامل
- سیستم تیکت (ایجاد، پاسخ، وضعیت، اولویت، تخصیص، انتقال)
- سیستم چت (دایرکت، گروه، کانال)
- دپارتمانها و اپراتورها
- پیوستها و فایلها
- تگ و برچسب
- پاسخهای آماده (Canned Responses)
- رضایتسنجی (CSAT)
- SLA و زمان پاسخگویی
- آمار و گزارشات
- جستجو و فیلتر
- Real-time و Broadcasting
- نوتیفیکیشنها
- دستورات Artisan
- مثالهای کاربردی (API Controller مشتری، API Controller اپراتور، Livewire)
- بهترین شیوهها
- خلاصه متدها و کلاسها
License
MIT