Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.
PHP ai-agentsblueskyfacebookinstagramlaravellinkedinmastodonmcpmcp-serveropen-sourcerest-apiself-hostedsocial-mediasocial-media-managementsocial-media-schedulerthreadstiktokvuejsxyoutube
<?php
declare(strict_types=1);
use App\Models\SocialAccount;
test('a channel server is read from the account, else from the config when it is missing or null', function (string $factoryState, string $metaKey, string $attribute, string $configKey) {
$account = SocialAccount::factory()->{$factoryState}()->make();
$account->meta = [...$account->meta, $metaKey => 'https://server.example.test'];
expect($account->{$attribute})->toBe('https://server.example.test');
$account->meta = collect($account->meta)->except($metaKey)->all();
expect($account->{$attribute})->toBe(config($configKey));
$account->meta = [...$account->meta, $metaKey => null];
expect($account->{$attribute})->toBe(config($configKey));
})->with([
'bluesky' => ['bluesky', 'service', 'bluesky_service', 'trypost.platforms.bluesky.default_service'],
'mastodon' => ['mastodon', 'instance', 'mastodon_instance', 'trypost.platforms.mastodon.default_instance'],
]);