PHPackages                             mostafaarafat/laravel-datachat - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. mostafaarafat/laravel-datachat

ActiveLibrary[Database &amp; ORM](/categories/database)

mostafaarafat/laravel-datachat
==============================

AI-powered chat widget for Laravel databases - embed conversational analytics in your app

v1.0.0(1mo ago)01↑2900%MITPHPPHP ^8.0|^8.1|^8.2|^8.3|^8.4|^8.5

Since Mar 29Pushed 1mo agoCompare

[ Source](https://github.com/mostafaarafatt/laravel-datachat)[ Packagist](https://packagist.org/packages/mostafaarafat/laravel-datachat)[ RSS](/packages/mostafaarafat-laravel-datachat/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

DataChat - AI-Powered Chat Widget for Laravel
=============================================

[](#datachat---ai-powered-chat-widget-for-laravel)

 [![Laravel](https://camo.githubusercontent.com/5ff3a15cd8440175adcfae4b418405b099d94d7c9eca038d6d1879e138050836/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d313025324225323025374325323031312532422d7265643f7374796c653d666f722d7468652d6261646765266c6f676f3d6c61726176656c)](https://camo.githubusercontent.com/5ff3a15cd8440175adcfae4b418405b099d94d7c9eca038d6d1879e138050836/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d313025324225323025374325323031312532422d7265643f7374796c653d666f722d7468652d6261646765266c6f676f3d6c61726176656c) [![PHP](https://camo.githubusercontent.com/df7ece1d7a2c77cce72e478c69a4bf28b992fbfab356a3604a879e5e70ae387a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c75653f7374796c653d666f722d7468652d6261646765266c6f676f3d706870)](https://camo.githubusercontent.com/df7ece1d7a2c77cce72e478c69a4bf28b992fbfab356a3604a879e5e70ae387a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c75653f7374796c653d666f722d7468652d6261646765266c6f676f3d706870) [![React](https://camo.githubusercontent.com/3e9ed51eeb9ee50082b58576d7f45ef4bee38741229ba848b027b7ee0ff7cc79/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f52656163742d31382d626c75653f7374796c653d666f722d7468652d6261646765266c6f676f3d7265616374)](https://camo.githubusercontent.com/3e9ed51eeb9ee50082b58576d7f45ef4bee38741229ba848b027b7ee0ff7cc79/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f52656163742d31382d626c75653f7374796c653d666f722d7468652d6261646765266c6f676f3d7265616374) [![License](https://camo.githubusercontent.com/153acf9dff19deb8abfc598c53bac50a4ceae0f5c83a552711060d3d78d2c057/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e3f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/153acf9dff19deb8abfc598c53bac50a4ceae0f5c83a552711060d3d78d2c057/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e3f7374796c653d666f722d7468652d6261646765)

Transform your Laravel database into a conversational interface! DataChat allows users to ask questions in natural language and get instant insights from your data - no SQL knowledge required.

> **Built on top of [Laravel AI Database Assistant](https://github.com/mostafaarafatt/laravel-ai-database)** - Extends the powerful AI-to-SQL engine with an embeddable frontend widget.

---

✨ Features
----------

[](#-features)

- 🤖 **Natural Language Queries** - Ask questions in plain English
- 💬 **Embeddable Widget** - Drop-in chat interface for any website
- 🔒 **Secure by Default** - Row-level security, rate limiting, API key auth
- 🎨 **Fully Customizable** - Colors, position, suggestions, branding
- ⚡ **Real-time Responses** - Asynchronous processing with queues
- 📊 **Usage Analytics** - Track conversations, costs, and performance
- 🌐 **CORS Ready** - Easy cross-domain embedding
- 🔧 **Multi-AI Support** - Works with Anthropic Claude, OpenAI GPT-4, Google Gemini

---

📸 Screenshots
-------------

[](#-screenshots)

### Chat Widget

[](#chat-widget)

```
┌────────────────────────────────┐
│ DataChat           [×]         │
├────────────────────────────────┤
│                                │
│ 💡 Try asking:                 │
│ → How many users do we have?   │
│ → What is our revenue today?   │
│ → Show me recent orders        │
│                                │
├────────────────────────────────┤
│ [Type your question...]  [Send]│
└────────────────────────────────┘

```

### Dashboard

[](#dashboard)

- Widget configuration &amp; management
- Real-time analytics &amp; usage graphs
- Conversation history viewer
- API key management

---

🚀 Quick Start
-------------

[](#-quick-start)

### Requirements

[](#requirements)

- PHP 8.1 or higher
- Laravel 10.x or 11.x
- MySQL 5.7+ or PostgreSQL 10+
- Redis (recommended for queues)
- Node.js 18+ (for building widget)
- Composer 2.x

### Installation

[](#installation)

#### Step 1: Install via Composer

[](#step-1-install-via-composer)

```
composer require mostafaarafat/laravel-datachat
```

#### Step 2: Publish Configuration &amp; Run Migrations

[](#step-2-publish-configuration--run-migrations)

```
# Publish config file
php artisan vendor:publish --tag=datachat-config

# Run migrations
php artisan migrate

# Publish widget assets
php artisan vendor:publish --tag=datachat-assets
```

#### Step 3: Configure Your AI Provider

[](#step-3-configure-your-ai-provider)

Add your AI API key to `.env`:

```
# For Anthropic Claude (recommended)
ANTHROPIC_API_KEY=your_api_key_here

# OR for OpenAI
OPENAI_API_KEY=your_api_key_here

# OR for Google Gemini
GEMINI_API_KEY=your_api_key_here

# Choose your provider
DATACHAT_AI_PROVIDER=anthropic  # or 'openai' or 'gemini'
```

#### Step 4: Configure Queue (Important!)

[](#step-4-configure-queue-important)

DataChat processes messages asynchronously for better performance.

```
# In .env
QUEUE_CONNECTION=redis  # or 'database'
```

Start the queue worker:

```
php artisan queue:work --queue=datachat
```

For production, use [Laravel Supervisor](https://laravel.com/docs/queues#supervisor-configuration).

#### Step 5: Create Your First Widget

[](#step-5-create-your-first-widget)

```
php artisan datachat:install
```

This interactive command will:

- Create a widget configuration
- Generate an API key
- Set up default suggested questions
- Show installation code

---

📦 Usage
-------

[](#-usage)

### Embed Widget in Your Website

[](#embed-widget-in-your-website)

Add this code to any HTML page:

```
>

    My App

      DataChat.init({
        apiKey: 'dc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
        apiUrl: 'https://your-app.com'
      });

```

### Advanced Configuration

[](#advanced-configuration)

```

  DataChat.init({
    apiKey: 'dc_your_api_key_here',
    apiUrl: 'https://your-app.com',

    // Optional: User identification
    userId: '{{ auth()->id() }}',

    // Optional: Metadata for row-level security
    metadata: {
      customer_id: '123',
      plan_type: 'premium',
      tenant_id: 'acme_corp'
    }
  });

```

### Laravel Blade Integration

[](#laravel-blade-integration)

```
@extends('layouts.app')

@section('content')

        Dashboard

@endsection

@push('scripts')

      DataChat.init({
        apiKey: '{{ config('datachat.demo_key') }}', // Store in config
        apiUrl: '{{ config('app.url') }}',
        userId: '{{ auth()->id() }}',
        metadata: {
          role: '{{ auth()->user()->role }}',
          company_id: '{{ auth()->user()->company_id }}'
        }
      });

@endpush
```

---

🎛️ Dashboard Management
-----------------------

[](#️-dashboard-management)

Access the dashboard to manage your widgets:

```
https://your-app.com/datachat

```

**Note:** Dashboard requires authentication. Ensure users are logged in.

### Dashboard Features

[](#dashboard-features)

- **Widget List** - View all configured widgets
- **Create Widget** - Set up new chat interfaces
- **Analytics** - View usage stats and message volume
- **API Keys** - Generate and regenerate keys
- **Conversations** - Browse chat history
- **Suggested Questions** - Configure helpful prompts

---

⚙️ Configuration
----------------

[](#️-configuration)

Edit `config/datachat.php`:

```
return [
    // AI Provider
    'ai_provider' => env('DATACHAT_AI_PROVIDER', 'anthropic'),

    // Database connection
    'connection' => env('DATACHAT_DB_CONNECTION', null),

    // Security
    'strict_mode' => env('DATACHAT_STRICT_MODE', true),

    // Queue settings
    'queue' => [
        'enabled' => env('DATACHAT_QUEUE_ENABLED', true),
        'connection' => env('DATACHAT_QUEUE_CONNECTION', 'redis'),
        'queue_name' => env('DATACHAT_QUEUE_NAME', 'datachat'),
    ],

    // Cache
    'cache' => [
        'enabled' => env('DATACHAT_CACHE_ENABLED', true),
        'ttl' => env('DATACHAT_CACHE_TTL', 3600),
    ],

    // Rate limiting
    'rate_limits' => [
        'messages_per_day' => env('DATACHAT_MAX_MESSAGES_PER_DAY', 100),
        'messages_per_minute' => env('DATACHAT_MAX_MESSAGES_PER_MINUTE', 10),
    ],

    // Widget defaults
    'widget_defaults' => [
        'name' => 'DataChat',
        'primary_color' => '#3b82f6',
        'position' => 'bottom-right',
        'greeting_message' => 'Hi! Ask me anything about your data.',
    ],

    // CORS
    'cors' => [
        'allowed_origins' => env('DATACHAT_ALLOWED_ORIGINS', '*'),
        'allowed_methods' => ['GET', 'POST', 'OPTIONS'],
        'allowed_headers' => ['Content-Type', 'X-DataChat-Key', 'X-Requested-With'],
    ],
];
```

---

🔒 Security Features
-------------------

[](#-security-features)

### API Key Authentication

[](#api-key-authentication)

Every widget has a unique API key. Keys can be regenerated anytime:

```
php artisan datachat:generate-key {widget_id}
```

Or via dashboard: Widget Details → "Regenerate Key"

### Row-Level Security (User Scoping)

[](#row-level-security-user-scoping)

Restrict queries to user-specific data using metadata:

```
DataChat.init({
  apiKey: 'dc_xxx',
  apiUrl: 'https://app.com',
  metadata: {
    user_id: '123',      // Only show this user's data
    company_id: '456'    // Scope to company
  }
});
```

**Backend Implementation:**

Modify `ChatService` to apply scoping:

```
protected function applyScopingRules(array $metadata): void
{
    if (isset($metadata['user_id'])) {
        DB::table('orders')->where('user_id', $metadata['user_id']);
    }
}
```

### Rate Limiting

[](#rate-limiting)

Configure per-widget limits:

- **Daily limit** - Total messages per 24 hours
- **Per-minute limit** - Prevents spam/abuse

Users receive clear error messages when limits are reached.

### CORS Protection

[](#cors-protection)

Restrict widget usage to specific domains:

```
// In widget configuration
$widget->update([
    'allowed_domains' => ['example.com', 'app.example.com']
]);
```

Requests from other domains will be rejected.

### Strict Mode

[](#strict-mode)

When enabled (default), only `SELECT` queries are allowed. No `INSERT`, `UPDATE`, `DELETE`, or `DROP`.

```
DATACHAT_STRICT_MODE=true
```

---

🎨 Customization
---------------

[](#-customization)

### Widget Appearance

[](#widget-appearance)

Configure via dashboard or programmatically:

```
use Mostafaarafat\DataChat\Models\ChatConfig;

$widget = ChatConfig::create([
    'user_id' => auth()->id(),
    'widget_name' => 'Sales Assistant',
    'primary_color' => '#ff6b6b',  // Brand color
    'position' => 'bottom-left',   // or 'bottom-right'
    'greeting_message' => 'Hello! I can help you find sales data.',
    'max_messages_per_day' => 500,
]);
```

### Suggested Questions

[](#suggested-questions)

Add helpful prompts to guide users:

```
use Mostafaarafat\DataChat\Models\Suggestion;

Suggestion::create([
    'config_id' => $widget->id,
    'question' => 'Show me today\'s revenue',
    'category' => 'sales',
    'display_order' => 1,
]);
```

### Custom Styling

[](#custom-styling)

Override CSS variables:

```

  :root {
    --datachat-primary: #your-color;
    --datachat-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }

```

---

📊 Analytics &amp; Monitoring
----------------------------

[](#-analytics--monitoring)

### Usage Tracking

[](#usage-tracking)

DataChat automatically tracks:

- Message count per day
- Estimated AI API costs
- Active conversations
- Processing times

Access via dashboard or query directly:

```
use Mostafaarafat\DataChat\Models\Usage;

$usage = Usage::where('config_id', $widgetId)
    ->where('date', '>=', now()->subDays(30))
    ->get();

$totalMessages = $usage->sum('message_count');
$totalCost = $usage->sum('ai_api_cost');
```

### Conversation History

[](#conversation-history)

View all conversations:

```
use Mostafaarafat\DataChat\Models\Conversation;

$conversations = Conversation::where('config_id', $widgetId)
    ->with('messages')
    ->latest('last_message_at')
    ->get();
```

### Logs

[](#logs)

All errors are logged to Laravel's log system:

```
tail -f storage/logs/laravel.log | grep DataChat
```

---

🧪 Testing
---------

[](#-testing)

### Test Widget Locally

[](#test-widget-locally)

Create a test HTML file:

```
>

    DataChat Test

    DataChat Widget Test

      DataChat.init({
        apiKey: 'dc_your_test_key',
        apiUrl: 'http://localhost:8000'
      });

```

### Test API Endpoints

[](#test-api-endpoints)

```
# Test configuration endpoint
curl -X GET http://localhost:8000/api/datachat/config \
  -H "X-DataChat-Key: dc_your_api_key"

# Test sending a message
curl -X POST http://localhost:8000/api/datachat/message \
  -H "X-DataChat-Key: dc_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "How many users are there?",
    "session_id": "test_session_123"
  }'
```

### Automated Tests

[](#automated-tests)

Run package tests:

```
composer test
```

---

🐛 Troubleshooting
-----------------

[](#-troubleshooting)

### Widget Not Loading

[](#widget-not-loading)

**Problem:** Chat button doesn't appear

**Solutions:**

1. Check browser console for errors
2. Verify API key is correct
3. Ensure JavaScript files are loaded
4. Check CORS settings if embedding on external domain

```
# Check if files exist
ls -la public/vendor/datachat/

# If missing, republish:
php artisan vendor:publish --tag=datachat-assets --force
```

### Messages Not Sending

[](#messages-not-sending)

**Problem:** Messages appear but no response

**Solutions:**

1. Verify queue worker is running
2. Check Laravel logs for errors
3. Confirm AI API key is valid

```
# Check queue status
php artisan queue:work --queue=datachat --once

# Check logs
tail -f storage/logs/laravel.log
```

### API Key Invalid Error

[](#api-key-invalid-error)

**Problem:** 401 Unauthorized errors

**Solutions:**

1. Regenerate API key via dashboard
2. Clear browser cache
3. Verify key matches widget configuration

```
php artisan datachat:generate-key {widget_id}
```

### CORS Errors

[](#cors-errors)

**Problem:** "CORS policy: No 'Access-Control-Allow-Origin' header"

**Solutions:**

1. Add domain to allowed\_domains in widget settings
2. Check config/datachat.php CORS settings
3. Verify middleware is applied

```
// In widget configuration
$widget->update([
    'allowed_domains' => ['your-domain.com']
]);
```

### Queue Not Processing

[](#queue-not-processing)

**Problem:** Messages stuck in "processing" state

**Solutions:**

1. Restart queue worker
2. Check Redis connection
3. Review failed jobs

```
# Restart queue
php artisan queue:restart

# Check failed jobs
php artisan queue:failed

# Retry failed jobs
php artisan queue:retry all
```

### Widget Build Errors

[](#widget-build-errors)

**Problem:** `npm run build` fails

**Solutions:**

1. Use Node 18+
2. Clear npm cache
3. Delete node\_modules and reinstall

```
# Check Node version
node -v  # Should be 18+

# Clean install
rm -rf node_modules package-lock.json
npm install
npm run build
```

---

🚀 Production Deployment
-----------------------

[](#-production-deployment)

### 1. Environment Variables

[](#1-environment-variables)

```
# Production .env
APP_ENV=production
APP_DEBUG=false

# Queue
QUEUE_CONNECTION=redis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=your_secure_password
REDIS_PORT=6379

# AI Provider
ANTHROPIC_API_KEY=your_production_key
DATACHAT_AI_PROVIDER=anthropic

# Security
DATACHAT_STRICT_MODE=true
DATACHAT_ALLOWED_ORIGINS=https://yourdomain.com
```

### 2. Build Widget

[](#2-build-widget)

```
cd resources/js/widget
npm install --production
npm run build
```

### 3. Optimize Laravel

[](#3-optimize-laravel)

```
composer install --optimize-autoloader --no-dev
php artisan config:cache
php artisan route:cache
php artisan view:cache
```

### 4. Set Up Supervisor

[](#4-set-up-supervisor)

Create `/etc/supervisor/conf.d/datachat-worker.conf`:

```
[program:datachat-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /path/to/your/app/artisan queue:work redis --queue=datachat --sleep=3 --tries=3 --max-time=3600
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=www-data
numprocs=2
redirect_stderr=true
stdout_logfile=/path/to/your/app/storage/logs/worker.log
stopwaitsecs=3600
```

Reload Supervisor:

```
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start datachat-worker:*
```

### 5. CDN (Optional)

[](#5-cdn-optional)

For better performance, serve widget files via CDN:

```
# Upload to S3/CloudFront
aws s3 cp public/vendor/datachat/ s3://your-bucket/datachat/ --recursive
```

Update widget initialization:

```

```

### 6. SSL/HTTPS

[](#6-sslhttps)

Ensure your app is served over HTTPS for security.

### 7. Monitoring

[](#7-monitoring)

Set up error tracking (e.g., Sentry, Bugsnag):

```
composer require sentry/sentry-laravel
```

---

📈 Performance Optimization
--------------------------

[](#-performance-optimization)

### Caching

[](#caching)

Enable caching for repeated queries:

```
DATACHAT_CACHE_ENABLED=true
DATACHAT_CACHE_TTL=3600  # 1 hour
```

### Database Indexing

[](#database-indexing)

Add indexes for frequently queried columns:

```
CREATE INDEX idx_conversations_last_message ON datachat_conversations(last_message_at);
CREATE INDEX idx_messages_created ON datachat_messages(created_at);
CREATE INDEX idx_usage_config_date ON datachat_usage(config_id, date);
```

### Queue Optimization

[](#queue-optimization)

Use multiple workers for high traffic:

```
# In supervisor config
numprocs=4  # Run 4 workers
```

### Redis Optimization

[](#redis-optimization)

Configure Redis for queue performance:

```
# redis.conf
maxmemory 256mb
maxmemory-policy allkeys-lru
```

---

🔌 API Reference
---------------

[](#-api-reference)

### Configuration Endpoint

[](#configuration-endpoint)

```
GET /api/datachat/config
Headers:
  X-DataChat-Key: dc_your_api_key

Response:
{
  "name": "DataChat",
  "primary_color": "#3b82f6",
  "position": "bottom-right",
  "greeting_message": "Hi! Ask me anything.",
  "suggestions": [
    "How many users?",
    "Show revenue"
  ]
}
```

### Send Message

[](#send-message)

```
POST /api/datachat/message
Headers:
  X-DataChat-Key: dc_your_api_key
  Content-Type: application/json

Body:
{
  "message": "How many orders today?",
  "session_id": "session_abc123",
  "user_id": "user_456",
  "metadata": {
    "customer_id": "789"
  }
}

Response:
{
  "status": "processing",
  "conversation_id": 42
}
```

### Get Conversation

[](#get-conversation)

```
GET /api/datachat/conversation/{id}
Headers:
  X-DataChat-Key: dc_your_api_key

Response:
{
  "messages": [
    {
      "id": 1,
      "role": "user",
      "content": "How many orders today?",
      "created_at": "2025-03-30T10:30:00Z",
      "has_error": false
    },
    {
      "id": 2,
      "role": "assistant",
      "content": "You have 47 orders today.",
      "created_at": "2025-03-30T10:30:03Z",
      "has_error": false
    }
  ]
}
```

### Poll for New Messages

[](#poll-for-new-messages)

```
GET /api/datachat/conversation/{id}/poll?after_id=2
Headers:
  X-DataChat-Key: dc_your_api_key

Response:
{
  "messages": [
    {
      "id": 3,
      "role": "assistant",
      "content": "Latest response...",
      "created_at": "2025-03-30T10:31:00Z",
      "has_error": false
    }
  ]
}
```

---

🤝 Contributing
--------------

[](#-contributing)

We welcome contributions! Please follow these steps:

1. Fork the repository
2. Create a feature branch: `git checkout -b feature/amazing-feature`
3. Commit your changes: `git commit -m 'Add amazing feature'`
4. Push to branch: `git push origin feature/amazing-feature`
5. Open a Pull Request

### Development Setup

[](#development-setup)

```
# Clone repository
git clone https://github.com/mostafaarafatt/laravel-datachat.git
cd laravel-datachat

# Install dependencies
composer install
cd resources/js/widget
npm install

# Run tests
composer test
npm test
```

### Coding Standards

[](#coding-standards)

- Follow PSR-12 for PHP code
- Use ESLint for JavaScript
- Write tests for new features
- Update documentation

---

📝 Changelog
-----------

[](#-changelog)

### \[1.0.0\] - 2025-03-30

[](#100---2025-03-30)

#### Added

[](#added)

- Initial release
- AI-powered chat widget
- Dashboard for widget management
- Real-time message polling
- Usage analytics &amp; tracking
- Multi-AI provider support
- CORS &amp; security features
- Queue-based processing
- Customizable appearance
- Suggested questions
- Rate limiting

---

🛣️ Roadmap
----------

[](#️-roadmap)

### v1.1 (Q2 2025)

[](#v11-q2-2025)

- WebSocket support for real-time updates
- Voice input integration
- Export conversation to PDF/CSV
- Advanced analytics dashboard
- Multi-language support

### v1.2 (Q3 2025)

[](#v12-q3-2025)

- Team collaboration features
- Slack/Discord bot integration
- Custom AI model training
- White-label option
- Mobile SDK (iOS/Android)

### v2.0 (Q4 2025)

[](#v20-q4-2025)

- GraphQL support
- Workflow automation
- Advanced user permissions
- Data visualization in chat
- Plugin system

---

📄 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT license](LICENSE.md).

---

🙏 Credits
---------

[](#-credits)

Built by **[Mostafa Arafat](https://github.com/mostafaarafatt)**

Powered by:

- [Laravel AI Database Assistant](https://github.com/mostafaarafatt/laravel-ai-database)
- [Anthropic Claude](https://www.anthropic.com)
- [Laravel Framework](https://laravel.com)
- [React](https://react.dev)

---

💬 Support
---------

[](#-support)

- **Documentation:**
- **Issues:** [GitHub Issues](https://github.com/mostafaarafatt/laravel-datachat/issues)
- **Discussions:** [GitHub Discussions](https://github.com/mostafaarafatt/laravel-datachat/discussions)
- **Email:**
- **Twitter:** [@datachat](https://twitter.com/datachat)

---

⭐ Show Your Support
-------------------

[](#-show-your-support)

If you find this package helpful, please consider:

- ⭐ Starring the repository
- 🐛 Reporting bugs
- 💡 Suggesting features
- 📝 Writing tutorials
- 💰 [Sponsoring development](https://github.com/sponsors/mostafaarafatt)

---

Made with ❤️ for the Laravel community

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance90

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b2104ee86e384faa60bd0ee5800b917840bc409355093fee45542ab1a79ffa1?d=identicon)[mostafaarafatt](/maintainers/mostafaarafatt)

---

Top Contributors

[![mostafaarafat199](https://avatars.githubusercontent.com/u/163301569?v=4)](https://github.com/mostafaarafat199 "mostafaarafat199 (2 commits)")

---

Tags

aianthropicchatbotdatabasegeminilaravelopenaiphpreactwidgetlaraveldatabaseaiwidgetanalyticschatbot

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mostafaarafat-laravel-datachat/health.svg)

```
[![Health](https://phpackages.com/badges/mostafaarafat-laravel-datachat/health.svg)](https://phpackages.com/packages/mostafaarafat-laravel-datachat)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k7.2M71](/packages/mongodb-laravel-mongodb)[ntanduy/cloudflare-d1-database

Easy configuration and setup for D1 Database connections in Laravel.

215.4k](/packages/ntanduy-cloudflare-d1-database)[toponepercent/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)[dragon-code/laravel-data-dumper

Adding data from certain tables when executing the `php artisan schema:dump` console command

3418.6k](/packages/dragon-code-laravel-data-dumper)[aimeos/laravel-nestedset

Nested Set Model for Laravel

292.0k2](/packages/aimeos-laravel-nestedset)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
