Download the PHP package martin6363/filament-ai-translator without Composer

On this page you can find all versions of the php package martin6363/filament-ai-translator. 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 filament-ai-translator

Filament AI Translator

AI-powered, one-click translations for Filament form fields โ€” built for Spatie Translatable and locale-suffixed layouts alike.

Latest Version PHP Version Laravel Version Filament Version

Translate content across locales in seconds using Google Gemini โ€” directly inside your Filament admin panel.


โœจ Features

Feature Description
๐ŸŒ Dual-Mode Integration Works with Spatie Translatable JSON/array field states and separate locale-suffixed columns such as title_en, title_am, title_ru.
๐Ÿง  Smart Suffix & Layout Detection Detects sibling locale fields inside Tabs, Sections, or any nested Filament layout. Uses Filament's Set Utility and Livewire state paths to populate related fields automatically.
๐Ÿ”„ Resilient AI Failover If the primary Gemini model is under high demand, the package gracefully rotates through gemini-2.5-flash, gemini-2.0-flash, and gemini-1.5-flash to keep translations flowing.
๐ŸŽจ Adaptive UI Adds a sleek translate action as a suffix on affix-capable fields (TextInput, Select, โ€ฆ) or as a hint on complex editors like RichEditor.
โšก Filament 4 & 5 Ready Built on the modern Filament\Contracts\Plugin architecture with a clean ->aiTranslate() macro on any form Field.
๐Ÿ”” Polished UX Loading, success, and failure states are surfaced through native Filament notifications.

๐Ÿ“ธ Demo

Screenshot (recommended: Tab layout with title_en / title_am / title_ru fields).

Example: translate from the English tab and instantly populate Russian sibling fields.


Example: Spatie translatable


๐Ÿ“ฆ Installation

Install the package via Composer:

Publish the configuration file:

Publish the language files (optional โ€” customize notification and action labels):

Register the plugin in your Filament panel provider:

Note: The package auto-registers via Laravel package discovery. You only need to add the plugin to your panel.


๐Ÿ” Environment Setup

Add your Google Gemini credentials to .env:

Variable Required Description
GEMINI_API_KEY Yes API key from Google AI Studio.
GEMINI_MODEL No Primary model. Defaults to gemini-2.0-flash. Fallback models are tried automatically on high-demand errors.

Security: Never commit API keys to version control. Restrict keys in Google AI Studio, rotate them regularly, and use environment-specific secrets in production (e.g. encrypted env, vault, or CI secrets).


โš™๏ธ Configuration

After publishing, customize config/filament-ai-translator.php:

The default_locales array is used when ->aiTranslate() is called without explicit locales. Align these with your Spatie Translatable setup or your _locale field suffixes.


๐Ÿš€ Usage

Attach ->aiTranslate() to any Filament form field. The macro is registered on Filament\Forms\Components\Field and works with TextInput, Textarea, RichEditor, and more.

Zero-configuration (implicit locales)

Call ->aiTranslate() without arguments to use config('filament-ai-translator.default_locales'):

How it behaves:

Explicit locales (custom)

Override the default locale list per field:

Spatie Translatable (JSON / array state)

Ideal with spatie/laravel-translatable and plugins such as Lara Zeus Spatie Translatable:

  1. Switch to your source locale using your translatable locale switcher.
  2. Type content in the active locale.
  3. Click the language action on the field.
  4. Save โ€” translations are written into the multi-locale state.

Separate fields layout (locale suffixes + Tabs)

Perfect when each locale has its own database column (title_en, title_am, title_ru):

Filament 5 note: Tabs live under Filament\Schemas\Components\Tabs. In Filament 4, you may use the equivalent layout component from your installed Filament version.

When translating from title_en, the plugin:

  1. Detects base name title and source locale en.
  2. Calls Gemini for targets am and ru.
  3. Sets title_am and title_ru via Filament's Set Utility โ€” even when those fields live in other tabs.

๐Ÿงฉ How it works (under the hood)


๐ŸŒ Translating UI strings

Publish translations to customize action labels and notifications:

Files are published to lang/vendor/filament-ai-translator/.


๐Ÿงช Requirements


๐Ÿ“‹ Changelog

Please see CHANGELOG.md for a history of releases and notable changes.

Unreleased


๐Ÿค Contributing

Contributions are welcome and appreciated.

Please keep PRs focused, follow existing code style, and include tests where applicable.


๐Ÿ™ Credits


๐Ÿ“„ License

The MIT License (MIT). See LICENSE for more information.


Made with โค๏ธ for the Filament community ยท GitHub


All versions of filament-ai-translator with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2|^8.3
illuminate/contracts Version ^11.0|^12.0|^13.0
filament/filament Version ^4.0|^5.0
google-gemini-php/client Version ^2.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 martin6363/filament-ai-translator contains the following files

Loading the files please wait ...