Filament CMS with Laravel AI SDK Actions

Filament 4/5

Filament CMS with actions in Post Edit page that use AI capabilities: create a tweet, suggest title options, translate post text, generate image thumbnail.

filament-laravel-ai-sdk-cms

Get the Source Code:

Only This Example

$9

One-time payment

Full source code for Filament CMS with Laravel AI SDK Actions
Downloadable ZIP file with the source code
Lifetime access to this example
GitHub Sign in with GitHub to buy

Sign in first, then complete your $9 checkout.

Best value — all 168 examples

FilamentExamples Membership

$99 /year
or
$199 lifetime
Access to code of all 168 examples
Future new examples and updates included
FilaCheck Pro package licence included
MCP server included
View membership plans

30-day money-back guarantee

How it works

The system is built around AI Agents that plug into Filament actions. When a user edits a post, they can trigger AI-powered actions from the toolbar:

app/Filament/Actions/SuggestTitleAction.php

$context = filled($record->title)
? "Current title: {$record->title}\n\nPost body:\n{$record->body}"
: "Post body:\n{$record->body}";
 
$response = (new TitleSuggesterAgent(customInstructions: $customPrompt))->prompt(
$context,
provider: static::resolveProvider($data),
model: static::resolveModel($data),
);

Each agent implements the Laravel AI SDK Agent contract and defines its own system instructions:

app/Ai/Agents/TitleSuggesterAgent.php

class TitleSuggesterAgent implements Agent
{
use Promptable;
 
public function __construct(public ?string $customInstructions = null) {}
 
public function instructions(): Stringable|string
{
if ($this->customInstructions) {
return $this->customInstructions;
}
 
return SystemPrompt::query()
->where('operation', 'title-suggester')
->value('prompt')
?? 'You are a blog title expert. Given a blog post body...';
}
}

The user picks a provider and model from a dropdown (only configured providers are shown), the agent calls the...

The FULL tutorial is available after the purchase: in the Readme file of the official repository you would get invited to.