The GPT Trix Editor is a form field component for the Filament PHP framework that enhances the Trix editor with OpenAI GPT features.
Features:
You can install the package via composer:
composer require askerakbar/gpt-trix-editor
php artisan vendor:publish --provider="OpenAI\Laravel\ServiceProvider"php artisan vendor:publish --tag="gpt-trix-editor-config"php artisan vendor:publish --tag="gpt-trix-editor-translations"
OPENAI_API_KEY=YOUR_KEY
You can also set the GPT model in the .env
TRIX_GPT_MODEL=YOUR_MODEL
php artisan config:clear
Import the field component:
use AskerAkbar\GptTrixEditor\Components\GptTrixEditor;
You can use the GPT Trix Editor field component like any other field component:
GptTrixEditor::make('content')->columnSpan('full');
By default, the GPT Toolbar Button is enabled in the GP Trix Editor. However, if you want to disable it, you can do so like this:
GptTrixEditor::make('content')->disableToolbarButtons([ 'gptTools',])->columnSpan('full');
If you would like to contriubte, please feel free to submit pull requests or open issues.
The MIT License (MIT). Please see License File for more information.