Files
m105 90f313c134 Add Cross-Posting support for multiple social accounts
- Create post_social_account pivot table for many-to-many relationship
- Add migration to migrate existing social_account_id to pivot table
- Remove social_account_id column from posts table
- Update Post model with socialAccounts() BelongsToMany relationship
- Update Posts Livewire component to use array of selectedAccountIds
- Update Posts view with checkboxes for selecting multiple accounts
- Update PublishPostJob to iterate through all social accounts of matching type
- Update Publisher interface to accept optional SocialAccount parameter
- Update all Publishers (WordPress, Reddit, Twitter, LinkedIn) to support cross-posting
- Display multiple social accounts as badges in posts table

Now a single post can be published to multiple social accounts of the same type.
For example: a Twitter post can be published to multiple Twitter accounts.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-07-27 21:24:49 +03:00

18 lines
429 B
PHP

<?php
namespace App\Support\Publishing;
use App\Models\Post;
use App\Models\SocialAccount;
interface Publisher
{
/**
* Whether this publisher handles the given post's type. Does not imply
* the post is actually publishable (see publish()'s rejected results).
*/
public function supports(Post $post): bool;
public function publish(Post $post, ?SocialAccount $socialAccount = null): PublishResult;
}