Search by

illuma-law / laravel-social-caster

miguelenes

A standalone Laravel package for social media publishing.

Package info

github.com/eloquage/laravel-social-caster

pkg:composer/illuma-law/laravel-social-caster

Statistics

Installs: 64

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 3

v0.1.5 2026-10-23 14:03 UTC

README

Laravel Social Caster publishing network

Publish content to supported social platforms through one Laravel API. The package validates content and account compatibility before making platform requests.

Tests Latest Version License

Requires PHP 8.3+ and Laravel 11, 12, or 13. Supported platforms are X, LinkedIn, Facebook, Instagram, Threads, and TikTok. Each platform requires its own developer application, access scopes, and credentials.

Install

composer require illuma-law/laravel-social-caster
php artisan vendor:publish --tag=social-caster-config

Implement the contracts

Your content object implements PublishableContent; your account model implements SocialCredentials. Keep access tokens in protected storage and return the token and provider metadata from the credential methods.

use Illuma\SocialCaster\Facades\SocialCaster;

// $post and $account are your application objects implementing the contracts.
$errors = SocialCaster::validate($post, $account);

if ($errors !== []) {
    throw new InvalidArgumentException(implode(' ', $errors));
}

$result = SocialCaster::publish($post, $account);

// Store the platform response details returned by the API.
$externalId = $result->externalId;
$rawResponse = $result->rawResponse;

PublishableContent supplies a platform, body, title, optional image/video, and metadata. SocialCredentials supplies the platform, access tokens, provider user ID, and provider-specific metadata. Publishing errors are thrown as exceptions; handle them in your queue or application boundary.

Configure limits

The published config/social-caster.php file controls preflight character limits and LinkedIn's default visibility. Use it to tune content validation for your application's publishing rules.

Test

composer test
composer analyse
vendor/bin/pint --test

MIT licensed. See LICENSE.