mahbuburriad / laravel-support-chat
Production-ready support chat package for Laravel applications with Livewire and Reverb-friendly real-time messaging.
Package info
github.com/mahbuburriad/laravel-chat-plugin
pkg:composer/mahbuburriad/laravel-support-chat
Requires
- php: ^8.2
- laravel/framework: ^11.0|^12.0
- livewire/livewire: ^3.5
Requires (Dev)
- orchestra/testbench: ^9.0|^10.0
- phpunit/phpunit: ^11.0
This package is auto-updated.
Last update: 2026-03-27 11:40:11 UTC
README
Production-ready support chat for Laravel applications with a floating customer widget, a Livewire-powered support inbox, database-backed conversations, and Reverb-friendly real-time updates.
Package Overview
mahbuburriad/laravel-support-chat is a reusable Laravel package for customer support messaging. It is designed for Blade-first apps and works without forcing Vue or React into the host application. The package ships with:
- A floating support widget for guest and authenticated customers
- A polished support inbox for agents
- Real-time messaging via Laravel broadcasting and Reverb
- Transfer, assignment, status tracking, internal notes, unread counts, and typing indicators
- Sensible defaults with clear configuration and publishable resources
Supported Versions
- PHP 8.2+
- Laravel 11 and 12
- Livewire 3
- Laravel Reverb or another Laravel broadcasting driver
Features
- Floating chat bubble with left/right positioning
- Responsive chat panel with welcome content and unread badge
- Guest chat and authenticated customer chat
- Real-time messages with polling fallback
- New message audio notification
- Agent inbox with filters for status, priority, and assignment
- Assign-to-self and agent-to-agent transfers
- Internal notes for support staff
- Conversation status management: open, pending, resolved, closed
- Theme and copy customization from config or optional
chat_settingsoverrides - Authorization through abilities or an agent flag column
- Private agent/customer channels plus tokenized guest channels
Installation
composer require mahbuburriad/laravel-support-chat php artisan support-chat:install php artisan migrate php artisan install:broadcasting
Add the widget to your layout:
<x-support-chat-widget />
Or:
@supportChatWidget
Reverb Setup
- Install broadcasting support if your app does not already have it:
php artisan install:broadcasting php artisan reverb:install
- Set your broadcast connection:
BROADCAST_CONNECTION=reverb SUPPORT_CHAT_BROADCAST_DRIVER=reverb
- Start Reverb and your queue worker:
php artisan reverb:start php artisan queue:work
- Load Echo in your host application. The package listens for standard Laravel Echo channel events from Livewire components.
Publish Steps
The installer publishes the essentials automatically. You can also publish resources manually:
php artisan vendor:publish --tag=support-chat-config php artisan vendor:publish --tag=support-chat-migrations php artisan vendor:publish --tag=support-chat-assets php artisan vendor:publish --tag=support-chat-views
Migration Steps
The package creates these tables:
chat_conversationschat_messageschat_participantschat_transferschat_noteschat_settings
Run:
php artisan migrate
Authorization Setup
Use one of these approaches:
- Define a gate for
manage-support-chat - Configure an agent flag column such as
is_support_agent
Example gate:
use Illuminate\Support\Facades\Gate; Gate::define('manage-support-chat', fn ($user) => $user->is_support_agent);
Example config:
'authorization' => [ 'agent_role_column' => 'is_support_agent', ],
Admin Integration
The package includes a route-based inbox at the configurable admin prefix:
'admin_route_prefix' => 'admin/support-chat',
Visit:
/admin/support-chat
If your app already has an admin layout, point the package to it:
'layouts' => [ 'admin' => 'layouts.admin', ],
You can also render the admin Livewire component inside an existing page:
<livewire:support-chat-admin-dashboard />
Frontend Integration
Global Widget
Drop the widget into your main Blade layout:
<x-support-chat-widget />
Dedicated Chat Page
The package includes a route-based page at:
/support-chat/chat
You can also embed the Livewire widget directly:
<livewire:support-chat-widget />
Configuration Example
return [ 'widget' => [ 'position' => 'right', 'title' => 'Need Help?', 'welcome_text' => 'Ask us anything. A human agent will reply shortly.', 'border_radius' => '28px', 'logo' => '/images/support-logo.png', 'sound' => [ 'enabled' => true, 'volume' => 0.35, ], 'theme' => [ 'primary' => '#0f766e', 'secondary' => '#ecfeff', ], ], 'chat' => [ 'allow_guest_chat' => true, ], 'authorization' => [ 'agent_role_column' => 'is_support_agent', ], ];
Screenshots
[Placeholder]Floating widget on storefront pages[Placeholder]Expanded customer chat panel[Placeholder]Support inbox with filters and transfer controls
Security Notes
- Agent access is gated through Laravel authorization
- Customer conversation access is restricted to the owning user
- Guest real-time channels use the conversation UUID plus guest token
- Messages are sanitized with
strip_tags()before storage - Message creation is rate-limited
- Livewire actions validate payloads before persistence
- Sensitive agent actions are policy-protected
Roadmap
- Attachments and uploads
- Departments and routing rules
- Canned replies
- Email notifications
- Slack / Telegram relays
- Transcript export
- Chatbot handoff
Testing
Run the package test suite with:
composer test
Contribution Guide
- Fork the repository
- Create a feature branch
- Add or update tests with your change
- Submit a pull request with a focused description
Issues and PRs should prefer backward-compatible changes, documented config additions, and explicit security reasoning for anything involving channels or authorization.
License
Released under the MIT License.