postsimple/filament-postsimple
Composer 安装命令:
composer require postsimple/filament-postsimple
包简介
Send your Filament resources to PostSimple for AI-powered social media content generation
README 文档
README
Send content from your Filament admin panel to PostSimple with one click to automatically generate professional social media content powered by AI.
About PostSimple
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.
Features
- ✅ 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
Requirements
- 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
Installation
Install the package via Composer:
composer require postsimple/filament-postsimple
Publish the config file (optional):
php artisan vendor:publish --tag="filament-postsimple-config"
Configuration
1. Register the Plugin
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(), ]); }
2. Get Your API Key
- 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
3. Configure the API Key
Add your PostSimple API key to your .env file:
POSTSIMPLE_API_KEY=ps_your_api_key_here
Usage
Adding the Action to Resources
Recommended: 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 ]; }
Alternative: Table Row Action
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 ]); }
Example: Blog Post Resource
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 ]; } }
How It Works
- 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
Model Requirements
The plugin works best when your models follow certain conventions, but it's flexible enough to work with any structure.
Automatic Title Detection
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')
Automatic URL Detection
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); } }
When Customization is Required
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)
Customization
Custom Title Field
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'
Custom URL
You can provide a custom closure to generate the URL:
SendToPostSimpleTableAction::make() ->urlUsing(fn ($record) => route('shop.product', $record))
Complete Customization Example
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 ]); }
Using Both Title and URL Customization
SendToPostSimpleAction::make() ->titleAttribute('custom_heading') ->urlUsing(function ($record) { return config('app.frontend_url') . '/posts/' . $record->id; })
Configuration Options
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_here
Translations
The 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/.
Troubleshooting
"PostSimple API key not configured"
- Add
POSTSIMPLE_API_KEY=your_keyto your.envfile - Run
php artisan config:clearif using config caching
"No title found"
- Ensure your model has a
title,name,heading, orsubjectfield - Or add a custom getter method
"No URL found"
- Add a
getUrl()orurl()method to your model - Or ensure your model has a
slugfield
"Failed to send to PostSimple"
- 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
Support
For questions or issues:
- Email: contact@postsimple.nl
- Website: https://postsimple.app
- Support: https://postsimple.app/support
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Security
If you discover any security-related issues, please email contact@postsimple.nl instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
postsimple/filament-postsimple 适用场景与选型建议
postsimple/filament-postsimple 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「ai」 「social-media」 「filament」 「filament-plugin」 「postsimple」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 postsimple/filament-postsimple 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 postsimple/filament-postsimple 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 postsimple/filament-postsimple 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Facebook/Instagram API (META) integration for Silverstripe
Support Module from OMMU
Alfabank REST API integration
This light package, with no dependencies, gives Eloquent models the ability to manage friendships (with groups). And interactions such as: Likes, favorites, votes, subscribe, follow, ..etc. And it includes advanced rating system.
Adds social media features to TYPO3 pages.
Database-driven onboarding for Filament: progress checklists and guided spotlight tours, translatable to any locale.
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-29