AI Actions plugin screenshot
Dark mode ready
No multilingual support
Supports v5.x

AI Actions by Muazzam Ali khan

Community

OpenAI-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().

Tags: Action
Supported versions:
5.x
Muazzam Ali khan avatar Author: Muazzam Ali khan

Package health

Automated checks of this plugin's Composer package

88 / 100
Security 85
Maintenance 100
Ecosystem 76
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.lock is 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 is 12.0, which receives security patches only (until 2027-02-24).
  • Passed: Current PHP version supported — Constraint ^8.2 supports current PHP 8.5.
  • Skipped: Current Symfony version supported
Third-party plugin. This is built by the community, not the Filament team. Filament does not review, endorse, or vet the security of plugins outside the 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 .
Powered by Plumb Last scanned 2 months ago

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:

Buy Me A Coffee

#License

MIT — see LICENSE.

The author

Muazzam Ali khan avatar Author: Muazzam Ali khan

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

Plugins
5
Stars
15

From the same author