Chat
1. Getting Started
Installation
Installation
Welcome to the Tokomono Chat (tokomono/chat) documentation! Tokomono Chat is a real-time AI chat package for Laravel powered by Laravel Reverb, Laravel AI (laravel/ai), and Tokomono AI Suite (tokomono/ai-suite). It allows you to connect any Laravel AI Agent, AI Suite Agent, or AI Suite Workflow to a responsive, customizable Vue chat interface or floating widget.
Requirements
- PHP 8.3 or higher
- Laravel 11.x / 12.x / 13.x
laravel/ai(^1.0)laravel/reverb(for real-time WebSocket streaming and connection status indicator)tokomono/ai-suite(optional, for AI Suite Workflow and Database Agent execution)- Vue 3 (for frontend components)
Installing via Composer
Install the package via Composer:
composer require tokomono/chat
Laravel's package auto-discovery automatically registers Tokomono\Chat\ChatServiceProvider.
Publishing Assets & Running Migrations
Publish the configuration file, Vue components, and database migrations:
php artisan vendor:publish --tag="chat-config"
php artisan vendor:publish --tag="chat-components"
php artisan migrate
Database Schema Extensions
tokomono/chat extends the standard laravel/ai tables (agent_conversations and agent_conversation_messages) with additional columns:
agent_conversations
| Column | Type | Description |
|---|---|---|
chat_hash |
string(100) (nullable, indexed) |
Links the conversation to the specific PHP Chat class hash (getHash()). |
user_id |
unsignedBigInteger (nullable, indexed) |
Authenticated user ID, or null when anonymous guest chatting (allowGuests(): true) is used. |
guest_token |
string(64) (nullable, indexed) |
Persistent identifier for anonymous guest sessions when user_id is null. |
deleted_at |
timestamp (nullable) |
Soft-delete timestamp so users can delete conversations from their UI while admins retain full logs. |
agent_conversation_messages
| Column | Type | Description |
|---|---|---|
message_type |
string(40) (indexed) |
Forces the frontend to render a specific Vue component (text, location, files, image, human_in_the_loop, rate_limit, error). |
payload |
longText (JSON) |
Structured payload data for the resolved message_type component. |
feedback_rating |
string(16) (nullable, indexed) |
User rating on assistant responses ('up' or 'down'). |
feedback_comment |
text (nullable) |
Optional text explanation submitted with the thumbs-up/down rating. |