PHPackages                             muazzambuilds/filament-ai-actions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. muazzambuilds/filament-ai-actions

ActiveLibrary

muazzambuilds/filament-ai-actions
=================================

OpenAI-powered Filament v5 actions for summarizing, rewriting, classifying, generating, and translating content.

v1.1.0(1mo ago)88↓75%1MITPHPPHP ^8.2

Since Jul 13Pushed 1mo agoCompare

[ Source](https://github.com/muazzambuilds/filament-ai-actions)[ Packagist](https://packagist.org/packages/muazzambuilds/filament-ai-actions)[ Docs](https://github.com/muazzambuilds/filament-ai-actions)[ RSS](/packages/muazzambuilds-filament-ai-actions/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (14)Versions (3)Used By (0)

Filament AI Actions
===================

[](#filament-ai-actions)

OpenAI-powered actions for **Filament v5**. Drop complete **Summarize**, **Rewrite**, **Classify**, **Generate**, and **Translate** actions onto tables and forms — no DIY prompt wiring.

Requirements
------------

[](#requirements)

DependencyVersionPHP`^8.2`Laravel`^11` / `^12`Filament`^5.0`OpenAIAPI keyInstallation
------------

[](#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
-----

[](#usage)

### Summarize

[](#summarize)

```
use MuazzamBuilds\FilamentAiActions\Actions\SummarizeAction;

SummarizeAction::make()
    ->attributes(['title', 'body'])
    ->applyTo('summary'); // optional: write result back to the record
```

### Rewrite

[](#rewrite)

```
use MuazzamBuilds\FilamentAiActions\Actions\RewriteAction;

RewriteAction::make()
    ->attributes(['body'])
    ->applyTo('body')
    ->tones([
        'professional' => 'Professional',
        'casual' => 'Casual',
        'concise' => 'Concise',
    ]);
```

### Classify

[](#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

[](#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

[](#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

[](#custom-content-source)

```
SummarizeAction::make()
    ->content(fn ($record) => "Title: {$record->title}\n\n{$record->body}");
```

### Generation controls and result handling

[](#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

[](#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
-------------

[](#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
-------

[](#support)

If this package helps you, consider supporting development:

[![Buy Me A Coffee](https://camo.githubusercontent.com/ae1848f99ea87c538c70dd9051798b769ba715939b8398ed02ad68a7da5d22bc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4275792532304d6525323061253230436f666665652d6666646430303f7374796c653d666f722d7468652d6261646765266c6f676f3d6275792d6d652d612d636f66666565266c6f676f436f6c6f723d626c61636b)](https://buymeacoffee.com/muazzambuilds)

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance91

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

2

Last Release

42d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/300896156?v=4)[Muazzam Ali Khan](/maintainers/muazzambuilds)[@muazzambuilds](https://github.com/muazzambuilds)

---

Top Contributors

[![muazzambuilds](https://avatars.githubusercontent.com/u/300896156?v=4)](https://github.com/muazzambuilds "muazzambuilds (3 commits)")

---

Tags

laravelaiopenaiactionsfilamentfilament-plugin

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/muazzambuilds-filament-ai-actions/health.svg)

```
[![Health](https://phpackages.com/badges/muazzambuilds-filament-ai-actions/health.svg)](https://phpackages.com/packages/muazzambuilds-filament-ai-actions)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3365.5M359](/packages/psalm-plugin-laravel)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

818355.4k3](/packages/defstudio-telegraph)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

80732.6M270](/packages/laravel-mcp)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3915.5k](/packages/rawilk-profile-filament-plugin)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5226.7k](/packages/simplestats-io-laravel-client)[illuminate/auth

The Illuminate Auth package.

10528.8M1.4k](/packages/illuminate-auth)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
