Send content from your Filament admin panel to PostSimple with one click to automatically generate professional social media content powered by AI.
PostSimple is an AI-powered social media tool that automatically creates and schedules social media posts tailored to your brand's style across all channels. This Filament plugin allows you to seamlessly send content from your Filament resources to PostSimple for instant social media content generation.
- âś… One-click integration - Send any resource to PostSimple with a single click
- âś… Easy configuration - Simple API key setup via .env file
- âś… Automatic detection - Intelligently finds title and URL from your models
- âś… Works everywhere - Add to any Filament resource (Posts, Pages, Products, etc.)
- âś… Multi-language support - Includes English and Dutch translations
- âś… Secure - API key stored in environment variables
- PHP 8.1 or higher
- Laravel 10.0 or higher
- Filament 4.x or 5.x
- PostSimple Pro subscription with API access
Note: The PostSimple API is only available with a Pro subscription. Request your API key at api@postsimple.nl
Install the package via Composer:
composer require postsimple/filament-postsimplePublish the config file (optional):
php artisan vendor:publish --tag="filament-postsimple-config"Add the plugin to your Filament panel provider (e.g., app/Providers/Filament/AdminPanelProvider.php):
use PostSimple\FilamentPostSimple\FilamentPostSimplePlugin;
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugins([
FilamentPostSimplePlugin::make(),
]);
}- Ensure you have a PostSimple Pro subscription
- Send an email to api@postsimple.nl with:
- Your company name
- Your PostSimple account email
- Your website URL
- You'll receive your API key within 1-2 business days
Add your PostSimple API key to your .env file:
POSTSIMPLE_API_KEY=ps_your_api_key_hereRecommended: Add the action to your
EditRecordorViewRecordpages. This ensures the record context is properly available.
Add to your resource's EditRecord or ViewRecord page:
use PostSimple\FilamentPostSimple\Actions\SendToPostSimpleAction;
protected function getHeaderActions(): array
{
return [
SendToPostSimpleAction::make(),
// ... other actions
];
}If you prefer to add the action directly in your resource table, you can use SendToPostSimpleTableAction:
use PostSimple\FilamentPostSimple\Actions\SendToPostSimpleTableAction;
public static function table(Table $table): Table
{
return $table
->columns([
// ... your columns
])
->actions([
SendToPostSimpleTableAction::make(),
// ... other actions
]);
}Here's a complete example of adding PostSimple to a blog post resource. Add the action to your EditPost page:
<?php
namespace App\Filament\Resources\PostResource\Pages;
use App\Filament\Resources\PostResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;
use PostSimple\FilamentPostSimple\Actions\SendToPostSimpleAction;
class EditPost extends EditRecord
{
protected static string $resource = PostResource::class;
protected function getHeaderActions(): array
{
return [
Actions\DeleteAction::make(),
SendToPostSimpleAction::make(), // Add this line
];
}
}- Click the "Send to PostSimple" button on any record
- Confirm the action in the modal
- The plugin sends the title and URL to PostSimple
- You're automatically redirected to PostSimple to view the generated content
The plugin works best when your models follow certain conventions, but it's flexible enough to work with any structure.
The plugin automatically looks for these fields (in order):
- Custom field (if you specify with
->titleAttribute()) titlenameheadingsubject- Falls back to
ModelName #ID
Example:
// Works automatically - has 'title' field
class Post extends Model {
protected $fillable = ['title', 'content'];
}
// Works automatically - has 'name' field
class Product extends Model {
protected $fillable = ['name', 'price'];
}
// Needs customization - has different field
class Article extends Model {
protected $fillable = ['headline', 'body'];
}
// Use: ->titleAttribute('headline')The plugin tries to get the URL in this order:
- Custom closure (if you specify with
->urlUsing()) $record->getUrl()method$record->url()method- Builds from
slugfield:/table-name/{slug} - Falls back to:
/table-name/{id}
Example with getUrl() method:
class Post extends Model
{
protected $fillable = ['title', 'slug', 'content'];
// Add this method to your model
public function getUrl(): string
{
return url('/blog/' . $this->slug);
}
}Example with route helper:
class Product extends Model
{
public function getUrl(): string
{
return route('products.show', $this);
}
}You need to customize when:
- Your title field has a non-standard name (not
title,name,heading, orsubject) - You need a specific URL format that can't be auto-detected
- You're working with a headless frontend (different domain)
Product example with customization:
SendToPostSimpleTableAction::make()
->titleAttribute('product_name')
->urlUsing(fn ($record) => 'https://shop.example.com/products/' . $record->sku)If your model uses a different field for the title, you can specify it:
SendToPostSimpleAction::make()
->titleAttribute('product_name') // Use 'product_name' instead of 'title'You can provide a custom closure to generate the URL:
SendToPostSimpleTableAction::make()
->urlUsing(fn ($record) => route('shop.product', $record))use PostSimple\FilamentPostSimple\Actions\SendToPostSimpleTableAction;
public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('product_name'),
Tables\Columns\TextColumn::make('sku'),
])
->actions([
SendToPostSimpleTableAction::make()
->titleAttribute('product_name') // Custom title field
->urlUsing(fn ($record) => route('shop.product', $record->slug)), // Custom URL
]);
}SendToPostSimpleAction::make()
->titleAttribute('custom_heading')
->urlUsing(function ($record) {
return config('app.frontend_url') . '/posts/' . $record->id;
})The plugin publishes a config file with the following options:
return [
// Your PostSimple API key (required)
'api_key' => env('POSTSIMPLE_API_KEY'),
// API endpoint (don't change unless instructed)
'api_endpoint' => env('POSTSIMPLE_API_ENDPOINT', 'https://postsimple.link/api/plugins/create-post'),
// PostSimple app URL
'app_url' => env('POSTSIMPLE_APP_URL', 'https://my.postsimple.app/lab'),
// Request timeout (seconds)
'timeout' => env('POSTSIMPLE_TIMEOUT', 30),
];Add to your .env file:
POSTSIMPLE_API_KEY=ps_your_api_key_hereThe plugin includes translations for English and Dutch. The language is automatically detected from your Laravel application's locale.
To publish and customize the translations:
php artisan vendor:publish --tag="filament-postsimple-lang"This will publish the language files to lang/vendor/filament-postsimple/.
- Add
POSTSIMPLE_API_KEY=your_keyto your.envfile - Run
php artisan config:clearif using config caching
- Ensure your model has a
title,name,heading, orsubjectfield - Or add a custom getter method
- Add a
getUrl()orurl()method to your model - Or ensure your model has a
slugfield
- Check that your API key is correct
- Verify you have an active Pro subscription
- Check your internet connection
- View the error message for more details
For questions or issues:
- Email: contact@postsimple.nl
- Website: https://postsimple.app
- Support: https://postsimple.app/support
Please see CHANGELOG for more information on what has changed recently.
Contributions are welcome! Please feel free to submit a Pull Request.
If you discover any security-related issues, please email contact@postsimple.nl instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.