syofyanzuhad / filament-chatflow
A conversational chatbot flow builder plugin for Filament v3 with conditional logic and floating chat widget
Fund package maintenance!
syofyanzuhad
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/syofyanzuhad/filament-chatflow
Requires
- php: ^8.2
- filament/filament: ^4.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.1
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
README
A powerful conversational flow builder plugin for Filament v3. Create interactive chatbot experiences with conditional logic, multi-language support, and comprehensive analytics.
Note: This is the stable branch for Filament v3. For Filament v4 support, use the
v4branch or install version^2.0.
Features
- ๐จ Visual Flow Builder - Build chat flows with an intuitive form-based interface
- ๐ฌ Floating Chat Widget - Beautiful, responsive chat widget that works on all pages
- ๐ Multi-Language Support - Built-in support for multiple languages (English & Indonesian included)
- ๐ Analytics Dashboard - Track conversation metrics, completion rates, and drop-off points
- ๐ง Email Transcripts - Automatically send conversation transcripts via email
- ๐ฏ Conditional Logic - Create complex conversation flows with if-else branching
- ๐ Sound Notifications - Optional sound notifications for new messages
- ๐ Dark Mode Support - Full dark mode compatibility
- โก Rate Limiting - Built-in API rate limiting for security
- ๐งช Comprehensive Testing - Full test coverage with Pest v4
Requirements
- PHP 8.3 or higher
- Laravel 12.x
- Filament 3.x
- Livewire 3.x
Installation
- Install the package via composer:
composer require syofyanzuhad/filament-chatflow
- Run the installation command:
php artisan filament-chatflow:install
This will publish the config file, migrations, and ask to run migrations.
Alternatively, you can publish and run the migrations manually:
php artisan vendor:publish --tag="filament-chatflow-migrations"
php artisan migrate
- Register the plugin in your Filament Panel Provider:
use Syofyanzuhad\FilamentChatflow\FilamentChatflowPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ FilamentChatflowPlugin::make(), ]); }
Configuration
Publish the config file (if not already published):
php artisan vendor:publish --tag="filament-chatflow-config"
The config file contains options for:
- Widget appearance and behavior
- Conversation expiration settings
- Email transcript configuration
- Analytics settings
- Rate limiting
- Security options
- And more...
Usage
Creating a Chatflow
-
Navigate to Chatflow in your Filament panel
-
Click New Chatflow
-
Fill in basic information:
- Name
- Description
- Welcome message (multi-language supported)
- Widget position (bottom-right, bottom-left, top-right, top-left)
- Theme color
- Email and notification settings
-
Click Save and you'll be redirected to the Flow Builder
Building the Conversation Flow
The Flow Builder allows you to create conversation steps:
- Message Steps - Display information to users
- Question Steps - Present options for users to choose
- End Steps - Conclude the conversation
Each step supports:
- Multi-language content (English & Indonesian by default)
- Nested child steps for complex flows
- Quick reply options with branching logic
Example flow structure:
Welcome Message
โโโ Question: "How can we help you?"
โโโ Option 1: "Product Inquiry"
โ โโโ Message: "Visit our catalog..."
โโโ Option 2: "Technical Support"
โ โโโ Question: "What issue?"
โ โโโ "Login Issue" โ Solution steps
โ โโโ "Performance" โ Solution steps
โโโ Option 3: "Other"
โโโ Message: "Contact us..."
Adding the Chat Widget to Your Frontend
Add the chat widget to your layout blade file:
<body> <!-- Your content --> @livewire('chatflow-widget', ['chatflow' => App\Models\Chatflow::find(1)]) </body>
Or use the chatflow ID directly:
@livewire('chatflow-widget', ['chatflow' => $chatflow])
Viewing Conversations
Navigate to Conversations in your Filament panel to:
- View all conversation history
- Filter by chatflow, status, date range, or language
- See detailed message timelines
- Track user information and metadata
Analytics Dashboard
The Analytics widget on your dashboard shows:
- Total conversations
- Active conversations
- Completed today
- Average completion rate
Access detailed analytics in the Chatflow Resource to see:
- Completion rates over time
- Drop-off points (where users abandon)
- Popular conversation paths
- Hourly distribution
API Endpoints
The package provides API endpoints for programmatic access:
// Get chatflow configuration GET /api/chatflow/{chatflow}/config // Start a conversation POST /api/chatflow/{chatflow}/start // Send a message POST /api/chatflow/message // End a conversation POST /api/chatflow/end // Get conversation history GET /api/chatflow/history
Seeding Sample Data
Run the seeder to create a sample customer support chatflow:
php artisan db:seed --class="Syofyanzuhad\\FilamentChatflow\\Database\\Seeders\\ChatflowSeeder"
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.