Download the PHP package zeeshantariq/filament-sqlgen without Composer
On this page you can find all versions of the php package zeeshantariq/filament-sqlgen. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zeeshantariq/filament-sqlgen
More information about zeeshantariq/filament-sqlgen
Files in zeeshantariq/filament-sqlgen
Package filament-sqlgen
Short Description A FilamentPHP package that generates SQL from natural language using Gemini AI.
License MIT
Informations about the package filament-sqlgen
filament-sqlgen
A FilamentPHP package that integrates a Gemini- or OpenAI-powered AI assistant into your Laravel admin panel — converting natural language into SQL and showing results in real-time.
Features
- Text-to-SQL AI: Converts natural language questions into SQL using Gemini or OpenAI and executes them securely.
- Read-only access: Executes only
SELECT
queries for safety. - Interactive UI: Results are rendered in a styled HTML table within the Filament widget.
- Easy setup: Plug-and-play widget for any FilamentPHP admin panel.
- AI provider config: Supports Gemini and OpenAI with flexible config options including temperature and token limits.
- History logging: Track all user queries and generated SQL with optional database logging.
Requirements
- Laravel 8 or above
- FilamentPHP 3.x or above
- A Gemini or OpenAI API key
Installation
Install via Composer:
Configuration
Publish Assets
You can publish configuration, views, migrations, or the schema separately:
🔧 Publish Config
🎨 Publish Views
📦 Publish Migrations
📊 Publish Schema File
This will allow you to customize the package settings, views, schema, and database behavior individually.
Add your AI settings to .env
🔹 For Gemini:
🔹 For OpenAI:
Configuration Notes:
- AI_PROVIDER: Choose between
gemini
andopenai
. - API Keys: Add the respective keys for each provider.
- Temperature and Max Tokens: Tune the model's creativity and output length.
Usage
Add the widget to your Filament dashboard or resource page:
Users can then type questions like:
"How many users signed up today?"
The AI will respond by generating and executing a query like:
The results are shown in a neat, scrollable table.
Security
Only SELECT
queries are allowed. All destructive operations like UPDATE
, DELETE
, or DROP
are blocked.
Customization
To override the widget view:
- Publish the views as shown above.
- Modify the Blade file at:
resources/views/vendor/filament-sqlgen/widgets/sql-gen-widget.blade.php
You can style it with Tailwind or modify the layout/logic to fit your needs.
History Log
Track and store all SQL generation activity using the built-in logging model (SqlGenLog
).
Contributing
Contributions are welcome! Please fork the repo, make changes, and open a pull request.
License
This package is open-source and licensed under the MIT license.
All versions of filament-sqlgen with dependencies
filament/support Version ^3.3
guzzlehttp/guzzle Version ^7.0
greenlion/php-sql-parser Version ^4.7