AI Actions by Muazzam Ali khan
CommunityOpenAI-powered actions for Filament v5. Drop complete Summarize, Rewrite, and Classify actions onto tables and forms — no DIY prompt wiring. Install via Composer, set OPENAI_API_KEY, then attach actions to table record actions or page header actions. Optionally write results back to a model attribute with applyTo().
Author:
Muazzam Ali khan
Package health
Automated checks of this plugin's Composer package
15 checks
- Skipped: GitHub Actions pinned to SHA
- Skipped: GitLab CI includes pinned to SHA
- Passed: Open security advisories
- Passed: Dependabot PR responsiveness — No open Dependabot PRs.
- Skipped: Renovate MR responsiveness
- Skipped: Dependabot or Renovate configured
- Skipped: Dependency update cooldown configured
- Failed: Provides a security policy — View details on Plumb
- Passed: Abandoned or archived — No consulted source marks the package abandoned (packagist, github).
- Passed: Commit and release recency — Active: last commit 26 days ago; last release 26 days ago.
-
Passed:
composer.lock not committed by library
—
composer.lockis absent from the released dist archive. - Passed: Dist archive is lean
-
Warning:
Current Laravel version supported
—
Package does not co-install with current Laravel
13.0; the newest co-installable line is12.0, which receives security patches only (until 2027-02-24). -
Passed:
Current PHP version supported
—
Constraint
^8.2supports current PHP8.5. - Skipped: Current Symfony version supported
filament/
namespace. Review the source and install at your own risk. Found
malware or an unresolved security issue the author won't
address?
Report it
.
Documentation
OpenAI-powered actions for Filament v5. Drop complete Summarize, Rewrite, Classify, Generate, and Translate actions onto tables and forms — no DIY prompt wiring.
#Requirements
| Dependency | Version |
|---|---|
| PHP | ^8.2 |
| Laravel | ^11 / ^12 |
| Filament | ^5.0 |
| OpenAI | API key |
#Installation
composer require muazzambuilds/filament-ai-actions
Publish config (optional):
php artisan vendor:publish --tag=filament-ai-actions-config
OPENAI_API_KEY=sk-...
OPENAI_MODEL=gpt-4o-mini
Optional panel registration:
use MuazzamBuilds\FilamentAiActions\AiActionsPlugin;
$panel->plugin(
AiActionsPlugin::make()
->model('gpt-4o-mini')
->enabled(fn (): bool => app()->environment('production'))
);
Panel settings are inherited by every action in that panel. Per-action model() and enabled() settings take precedence or further restrict availability. Registering the plugin is optional; actions fall back to package configuration when no plugin is registered.
#Usage
#Summarize
use MuazzamBuilds\FilamentAiActions\Actions\SummarizeAction;
SummarizeAction::make()
->attributes(['title', 'body'])
->applyTo('summary'); // optional: write result back to the record
#Rewrite
use MuazzamBuilds\FilamentAiActions\Actions\RewriteAction;
RewriteAction::make()
->attributes(['body'])
->applyTo('body')
->tones([
'professional' => 'Professional',
'casual' => 'Casual',
'concise' => 'Concise',
]);
#Classify
use MuazzamBuilds\FilamentAiActions\Actions\ClassifyAction;
ClassifyAction::make()
->attributes(['body'])
->labels([
'bug' => 'Bug report',
'feature' => 'Feature request',
'question' => 'Question',
])
->applyTo('category');
Classification only accepts one of the configured label keys (or values for a list). JSON responses such as {"label":"bug"} are supported, and invalid or ambiguous model output is never persisted.
#Generate
use MuazzamBuilds\FilamentAiActions\Actions\GenerateAction;
GenerateAction::make()
->attributes(['title', 'body']) // optional context
->applyTo('generated_copy');
The modal asks for a generation prompt and lets the user review or edit the context before submitting.
#Translate
use MuazzamBuilds\FilamentAiActions\Actions\TranslateAction;
TranslateAction::make()
->attributes(['body'])
->defaultLanguage('es')
->applyTo('translated_body');
The language field is a searchable dropdown containing all 183 ISO 639-1 languages by default. Use languages([...]) only when you want to restrict or customize the available targets:
TranslateAction::make()
->languages([
'en' => 'English',
'es' => 'Spanish',
'ur' => 'Urdu',
]);
#Custom content source
SummarizeAction::make()
->content(fn ($record) => "Title: {$record->title}\n\n{$record->body}");
#Generation controls and result handling
All actions support per-action model controls and custom prompts:
SummarizeAction::make()
->model('gpt-4o')
->temperature(0.2)
->maxTokens(600)
->systemPrompt(fn ($record) => "Summarize this {$record->type} for executives.")
->applyTo('summary');
applyTo() saves the model by default. To fill the model and refresh an open Filament form without saving it automatically, use saveResult(false):
RewriteAction::make()
->attributes(['body'])
->applyTo('body')
->saveResult(false);
For complete control, replace the default assignment and persistence behavior:
GenerateAction::make()
->applyResultUsing(function (string $result, $record, $livewire): void {
// Store, transform, dispatch, or audit the result.
});
The generated result is also shown in a persistent success notification. saveResult(false) is the recommended option when a user must review and save changes manually.
#Table example
use Filament\Tables\Table;
use MuazzamBuilds\FilamentAiActions\Actions\ClassifyAction;
use MuazzamBuilds\FilamentAiActions\Actions\GenerateAction;
use MuazzamBuilds\FilamentAiActions\Actions\RewriteAction;
use MuazzamBuilds\FilamentAiActions\Actions\SummarizeAction;
use MuazzamBuilds\FilamentAiActions\Actions\TranslateAction;
public function table(Table $table): Table
{
return $table
->recordActions([
SummarizeAction::make()->attributes(['title', 'body'])->applyTo('summary'),
RewriteAction::make()->attributes(['body'])->applyTo('body'),
ClassifyAction::make()
->attributes(['body'])
->labels(['bug', 'feature', 'question'])
->applyTo('category'),
GenerateAction::make()->attributes(['title', 'body'])->applyTo('draft'),
TranslateAction::make()->attributes(['body'])->applyTo('translated_body'),
]);
}
Actions hide themselves when OPENAI_API_KEY is missing, when the panel plugin is disabled, or when their own enabled() condition evaluates to false.
#Configuration
// config/filament-ai-actions.php
return [
'api_key' => env('OPENAI_API_KEY'),
'organization' => env('OPENAI_ORGANIZATION'),
'base_url' => env('OPENAI_BASE_URL', 'https://api.openai.com/v1'),
'model' => env('OPENAI_MODEL', 'gpt-4o-mini'),
'temperature' => 0.4,
'max_tokens' => 1200,
];
#Support
If this package helps you, consider supporting development:
#License
MIT — see LICENSE.
The author
AI Engineer & Laravel Developer building intelligent SaaS products, AI agents, and Filament applications. I help founders ship production-ready software — from AI automation to Laravel & Filament admin panels, SaaS platforms, and AI-powered ecommerce. I publish plugins and tutorials as Muazzam Builds.
What I'm Building
- AI Agents & business automation
- Laravel & Filament applications
- SaaS products and AI ecommerce
Tech Stack
Laravel • PHP • Filament • Livewire • MySQL • Python • Docker • OpenAI • Cloudflare • AWS
Connect
From the same author
Turnstile
Cloudflare Turnstile panel plugin — register once to auto-protect login, registration, and password reset.
Author:
Muazzam Ali khan
Recycle Bin
Central soft-deletes recycle bin for Filament v5. Register once, then restore or permanently delete trashed records from every SoftDeletes model in one place.
Author:
Muazzam Ali khan
Ban Guard
Ban or suspend users from your panel, with middleware that also blocks API access and login.
Author:
Muazzam Ali khan
Panel Branding
Rebrand your Filament panel from a settings page — logos, colors, fonts, layout, footer, and custom CSS, with per-panel and optional per-tenant support.
Author:
Muazzam Ali khan
Featured Plugins
A selection of plugins curated by the Filament team
Blueprint
Filament Blueprint is a premium Laravel Boost extension that helps AI agents produce accurate, detailed implementation plans and security reports for Filament apps.
Filament
Custom Fields
Eliminate custom field migrations forever. Let your users create and manage form fields directly in Filament admin panels with 20+ built-in field types, validation, and zero database changes.
Relaticle
Advanced Tables (formerly Filter Sets)
Supercharge your tables with powerful features like user-customizable views, quick filters, multi-column sorting, advanced table searching, convenient view management, and more. Compatible with Resource Panel Tables, Relation Managers, Table Widgets, and Table Builder!
Kenneth Sese