Download the PHP package hayderhatem/filament-natural-language-filter without Composer
On this page you can find all versions of the php package hayderhatem/filament-natural-language-filter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hayderhatem/filament-natural-language-filter
More information about hayderhatem/filament-natural-language-filter
Files in hayderhatem/filament-natural-language-filter
Package filament-natural-language-filter
Short Description Natural language filtering for Filament tables and forms
License MIT
Informations about the package filament-natural-language-filter
Filament Natural Language Filter
A simple Filament filter that converts natural language text into database queries using AI.
Installation
Configuration
-
Publish the config file:
- Add your OpenAI API key to your
.env
file:
Usage
Add the filter to your Filament table:
Search Modes
You can configure how the filter triggers searches:
Submit Mode (Default) - Search on Enter key
Live Mode - Search as you type
Manual Mode Configuration
When to Use Each Mode
Submit Mode (Default) - Best for:
- Large datasets where live search might be slow
- Complex queries that users want to perfect before searching
- Reducing API calls to OpenAI (only search when user is ready)
Live Mode - Best for:
- Instant feedback and better user experience
- Smaller datasets where performance isn't a concern
- Users who prefer immediate results as they type
How it works
- User enters natural language: "show users named john created after 2023"
- AI processes the text: Converts it to structured filters based on your available columns
- Database query is built:
WHERE name LIKE '%john%' AND created_at > '2023-01-01'
- Results are filtered: Table shows matching records
Examples
- "users named john" →
WHERE name LIKE '%john%'
- "active users" →
WHERE status = 'active'
- "created after 2023" →
WHERE created_at > '2023-01-01'
- "email contains gmail" →
WHERE email LIKE '%gmail%'
Universal Language Support 🌍
The filter supports ANY language with automatic AI translation and understanding:
Multi-Language Examples
English:
- "show users named john" →
WHERE name LIKE '%john%'
- "created after 2023" →
WHERE created_at > '2023-01-01'
Arabic (العربية):
- "الاسم يحتوي على أحمد" →
WHERE name LIKE '%أحمد%'
- "أنشئ بعد 2023" →
WHERE created_at > '2023-01-01'
Spanish (Español):
- "usuarios con nombre juan" →
WHERE name LIKE '%juan%'
- "creado después de 2023" →
WHERE created_at > '2023-01-01'
French (Français):
- "nom contient marie" →
WHERE name LIKE '%marie%'
- "créé après 2023" →
WHERE created_at > '2023-01-01'
German (Deutsch):
- "benutzer mit namen hans" →
WHERE name LIKE '%hans%'
- "erstellt nach 2023" →
WHERE created_at > '2023-01-01'
Chinese (中文):
- "姓名包含张三" →
WHERE name LIKE '%张三%'
- "2023年后创建" →
WHERE created_at > '2023-01-01'
Japanese (日本語):
- "田中という名前のユーザー" →
WHERE name LIKE '%田中%'
- "2023年以降に作成" →
WHERE created_at > '2023-01-01'
How It Works
- AI Language Detection: Automatically detects the input language
- Natural Understanding: Maps language-specific keywords to operators
- Value Preservation: Keeps original values in their native language/script
- Mixed Language: Handles mixed-language queries seamlessly
Mixed Language Queries
The AI can handle mixed-language queries naturally:
- "name يحتوي على john" ✅
- "usuario con email gmail.com" ✅
- "姓名 contains 张三" ✅
Configuration Options
Environment Variables
Requirements
- PHP 8.1+
- Laravel 10+
- Filament 3+
- OpenAI API key
License
MIT
All versions of filament-natural-language-filter with dependencies
laravel/framework Version ^11.0
filament/filament Version ^3.2
openai-php/laravel Version ^0.8
illuminate/support Version ^11.0