Download the PHP package mostafaarafat/laravel-datachat without Composer

On this page you can find all versions of the php package mostafaarafat/laravel-datachat. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-datachat

DataChat - AI-Powered Chat Widget for Laravel

Laravel PHP React License

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 - Extends the powerful AI-to-SQL engine with an embeddable frontend widget.


โœจ Features


๐Ÿ“ธ Screenshots

Chat Widget

Dashboard


๐Ÿš€ Quick Start

Requirements

Installation

Step 1: Install via Composer

Step 2: Publish Configuration & Run Migrations

Step 3: Configure Your AI Provider

Add your AI API key to .env:

Step 4: Configure Queue (Important!)

DataChat processes messages asynchronously for better performance.

Start the queue worker:

For production, use Laravel Supervisor.

Step 5: Create Your First Widget

This interactive command will:


๐Ÿ“ฆ Usage

Embed Widget in Your Website

Add this code to any HTML page:

Advanced Configuration

Laravel Blade Integration


๐ŸŽ›๏ธ Dashboard Management

Access the dashboard to manage your widgets:

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

Dashboard Features


โš™๏ธ Configuration

Edit config/datachat.php:


๐Ÿ”’ Security Features

API Key Authentication

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

Or via dashboard: Widget Details โ†’ "Regenerate Key"

Row-Level Security (User Scoping)

Restrict queries to user-specific data using metadata:

Backend Implementation:

Modify ChatService to apply scoping:

Rate Limiting

Configure per-widget limits:

Users receive clear error messages when limits are reached.

CORS Protection

Restrict widget usage to specific domains:

Requests from other domains will be rejected.

Strict Mode

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


๐ŸŽจ Customization

Widget Appearance

Configure via dashboard or programmatically:

Suggested Questions

Add helpful prompts to guide users:

Custom Styling

Override CSS variables:


๐Ÿ“Š Analytics & Monitoring

Usage Tracking

DataChat automatically tracks:

Access via dashboard or query directly:

Conversation History

View all conversations:

Logs

All errors are logged to Laravel's log system:


๐Ÿงช Testing

Test Widget Locally

Create a test HTML file:

Test API Endpoints

Automated Tests

Run package tests:


๐Ÿ› Troubleshooting

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

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

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

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

Queue Not Processing

Problem: Messages stuck in "processing" state

Solutions:

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

Widget Build Errors

Problem: npm run build fails

Solutions:

  1. Use Node 18+
  2. Clear npm cache
  3. Delete node_modules and reinstall

๐Ÿš€ Production Deployment

1. Environment Variables

2. Build Widget

3. Optimize Laravel

4. Set Up Supervisor

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

Reload Supervisor:

5. CDN (Optional)

For better performance, serve widget files via CDN:

Update widget initialization:

6. SSL/HTTPS

Ensure your app is served over HTTPS for security.

7. Monitoring

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


๐Ÿ“ˆ Performance Optimization

Caching

Enable caching for repeated queries:

Database Indexing

Add indexes for frequently queried columns:

Queue Optimization

Use multiple workers for high traffic:

Redis Optimization

Configure Redis for queue performance:


๐Ÿ”Œ API Reference

Configuration Endpoint

Send Message

Get Conversation

Poll for New Messages


๐Ÿค 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

Coding Standards


๐Ÿ“ Changelog

[1.0.0] - 2025-03-30

Added


๐Ÿ›ฃ๏ธ Roadmap

v1.1 (Q2 2025)

v1.2 (Q3 2025)

v2.0 (Q4 2025)


๐Ÿ“„ License

This package is open-sourced software licensed under the MIT license.


๐Ÿ™ Credits

Built by Mostafa Arafat

Powered by:


๐Ÿ’ฌ Support


โญ Show Your Support

If you find this package helpful, please consider:


Made with โค๏ธ for the Laravel community


All versions of laravel-datachat with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1|^8.2|^8.3|^8.4|^8.5
illuminate/support Version ^8.0|^8.1|^8.2|^8.3|^8.4|^8.5|^9.0|^10.0|^11.0
illuminate/database Version ^8.0|^8.1|^8.2|^8.3|^8.4|^8.5|^9.0|^10.0|^11.0
illuminate/http Version ^8.0|^8.1|^8.2|^8.3|^8.4|^8.5|^9.0|^10.0|^11.0
mostafaarafat/laravel-ai-database Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mostafaarafat/laravel-datachat contains the following files

Loading the files please wait ...