Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Ai Actions Laravel Package

muazzambuilds/filament-ai-actions

Filament AI Actions adds AI-powered actions to Filament admin panels, letting you run configurable prompts from resources, tables, and pages. Connect your AI provider and bring generative workflows into Laravel admin UIs with minimal setup.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install the package with Composer, then register its Filament panel plugin in your PanelProvider so the model() and enabled() settings can be resolved:
    ->plugin(AiActionsPlugin::make()
        ->model('gpt-4o-mini')
        ->enabled())
    
  • Look first at the package README/config file for the exact action class names and required LLM credentials. Publish the config (php artisan vendor:publish) and confirm the API key and default model are set before touching actions.
  • Start with a single table column action to validate the end-to-end flow (prompt → model call → saved result). A good first use case is SummarizeAction on a TextColumn:
    TextColumn::make('body')->actions([
        SummarizeAction::make(),
    ]);
    
  • Once that works, add a form-side GenerateAction or TranslateAction to confirm form actions behave correctly. TranslateAction is the easiest demo of the new release because it exposes the searchable 183-language dropdown out of the box.

Implementation Patterns

  • Table vs form actions. Summarize/Rewrite/Classify are most naturally used on table columns against existing records; Generate/Translate fit form fields where you want to fill or transform input before saving.
  • Generate in forms. Use sibling field state to build the prompt and applyResultUsing() to decide where the output lands:
    GenerateAction::make()
        ->applyResultUsing(fn (array $state, string $result) => ['summary' => $result]);
    
  • Preview before persisting. saveResult(false) turns the action into a dry-run: run it, inspect the output, and apply it yourself later. This is the right pattern for sensitive/large fields.
  • Classify with enums. With structured output parsing and invalid-label rejection in v1.1.0, pass a discrete label set and persist to an enum column; invalid responses are rejected rather than silently written.
  • Translate with restrictions. The full ISO 639-1 list is available by default. Restrict it per action when your domain only supports a subset:
    TranslateAction::make()->languages(['en', 'fr', 'de', 'es']);
    
  • Per-action tuning. Use systemPrompt(), temperature(), and maxTokens() on individual actions so creative rewrites and strict classifications can use different settings without touching the plugin config.
  • Chain with Filament conventions. Gate actions with visible()/authorize() policies, use ->afterFormFilled() or table callbacks for post-processing, and prefer applyResultUsing() over custom observers.
  • Panel-wide defaults. Set model/credentials once via the panel plugin and override only where an action needs a different model or is disabled.

Gotchas and Tips

  • Compatibility is promised, but verify persistence defaults. Existing Summarize/Rewrite/Classify usage should remain compatible; still confirm whether saveResult defaults to true in your version, because that changes whether results are written back to the record.
  • applyResultUsing() replaces default persistence. If you supply a callback, the action won't automatically save for you — call $record->save() or return the right state explicitly.
  • Plugin vs action precedence. model()/enabled() on the panel plugin are defaults; per-action systemPrompt()/temperature()/maxTokens() and any model override should win. If an action ignores your model, check the panel plugin isn't forcing it.
  • Structured output needs a capable model. Classify's invalid-label rejection depends on the model honoring structured output; smaller or older models may return prose and get rejected. Test classification against your actual configured model, not just the default.
  • Language dropdown is large. 183 options are fine for searchability but heavy if rendered many times; restrict with ->languages([...]) on dense tables/forms.
  • Token limits and cost. Long source text plus a generous maxTokens() can hit context limits or inflate costs; set maxTokens() deliberately and consider queueing actions for bulk/batch use.
  • Debugging. Log the raw model response alongside the parsed result; invalid-label errors and malformed structured output are much easier to diagnose with the raw payload. Wrap calls in try/catch or rely on Filament notifications for surfacing failures.
  • Create vs edit context. Form actions used on create screens have no record, so callbacks should not assume $record exists.
  • Extension points. Subclass an action to bake in a default systemPrompt()/languages(), or centralize model/credential selection in the panel plugin; avoid duplicating long prompts across resources.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core