PHPackages                             orox/socialposter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. orox/socialposter

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

orox/socialposter
=================

A social media posting package

02PHP

Since Jul 15Pushed 10mo agoCompare

[ Source](https://github.com/OroxMedia/SocialPoster)[ Packagist](https://packagist.org/packages/orox/socialposter)[ RSS](/packages/orox-socialposter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Got it! Here’s the README without any references to testing:

---

Laravel SocialPoster
====================

[](#laravel-socialposter)

A flexible, extensible Laravel package to post content to multiple social media platforms (Twitter, Facebook, Instagram) using the Strategy design pattern. Easily add new platforms, support multiple accounts, and track posts with Eloquent models.

---

Features
--------

[](#features)

- Strategy-based posting for multiple social media platforms
- Support for multi-account posting
- Polymorphic Eloquent model to track posts across platforms
- Reusable service classes to handle API communication
- Built-in Twitter integration example
- Easily extend with your own social media drivers
- Laravel-native, clean and testable design

---

Installation
------------

[](#installation)

Require the package via Composer:

```
composer require vendor/social-poster
```

Publish migrations and config:

```
php artisan vendor:publish --provider="Vendor\SocialPoster\SocialPosterServiceProvider" --tag="migrations"
php artisan migrate

php artisan vendor:publish --provider="Vendor\SocialPoster\SocialPosterServiceProvider" --tag="config"
```

---

Configuration
-------------

[](#configuration)

Edit the config file `config/socialposter.php` to add your social media account credentials:

```
return [
    'accounts' => [
        'twitter' => [
            'default' => [
                'consumer_key' => env('TWITTER_CONSUMER_KEY'),
                'consumer_secret' => env('TWITTER_CONSUMER_SECRET'),
                'access_token' => env('TWITTER_ACCESS_TOKEN'),
                'access_token_secret' => env('TWITTER_ACCESS_TOKEN_SECRET'),
                'bearer_token' => env('TWITTER_BEARER_TOKEN'),
                'account_id' => env('TWITTER_ACCOUNT_ID'),
            ],
            'brand_2' => [
                // secondary Twitter account credentials
            ],
        ],

        // Add Facebook, Instagram, etc.
    ],
];
```

---

Usage
-----

[](#usage)

### 1. Make your Eloquent models implement `SocialMediaPostable`

[](#1-make-your-eloquent-models-implement-socialmediapostable)

Use the provided trait and implement required methods:

```
use Vendor\SocialPoster\Contracts\SocialMediaPostable;
use Vendor\SocialPoster\Traits\IsSocialMediaPostable;

class Article extends Model implements SocialMediaPostable
{
    use IsSocialMediaPostable;

    public function getSocialMediaBody(string $platform): string
    {
        return $this->title . ' - Read more at ' . $this->url;
    }

    public function getSocialMediaImage(string $platform): ?string
    {
        return $this->featured_image_path;
    }
}
```

### 2. Use the `SocialPoster` facade or service class to post

[](#2-use-the-socialposter-facade-or-service-class-to-post)

```
use Vendor\SocialPoster\Facades\SocialPoster;
use Vendor\SocialPoster\Drivers\TwitterStrategy;

SocialPoster::using(new TwitterStrategy())
    ->post($article, 'default');
```

You can post to other platforms by creating your own Strategy classes implementing `SocialMediaStrategy`.

---

Adding New Platforms
--------------------

[](#adding-new-platforms)

Create a new Strategy implementing `SocialMediaStrategy` and a Service class handling API calls.

Example skeleton:

```
class FacebookStrategy implements SocialMediaStrategy
{
    public function getPlatform(): string
    {
        return 'facebook';
    }

    public function post(SocialMediaPostable $model, string $account): string
    {
        // Use your FacebookService to post content
    }
}
```

---

Database
--------

[](#database)

Your social media posts are stored in the `social_media_posts` table with polymorphic relations.

The table stores:

- Platform name (Twitter, Facebook, etc.)
- Account identifier
- Polymorphic postable model reference
- Social platform's post ID

---

License
-------

[](#license)

MIT License © Your Name or Company

---

Contributing
------------

[](#contributing)

Contributions are welcome! Please open issues and pull requests on GitHub.

---

Support
-------

[](#support)

If you find bugs or need help, open an issue on GitHub.

---

If you want me to generate any other docs or help with setup, just say the word!

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance40

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1643d15f48ade4de4b787f891ba5f8099b620d17bf99de34f993f23fbf7fa4b9?d=identicon)[pascalmasson](/maintainers/pascalmasson)

---

Top Contributors

[![PascalMasson](https://avatars.githubusercontent.com/u/7769875?v=4)](https://github.com/PascalMasson "PascalMasson (4 commits)")

### Embed Badge

![Health badge](/badges/orox-socialposter/health.svg)

```
[![Health](https://phpackages.com/badges/orox-socialposter/health.svg)](https://phpackages.com/packages/orox-socialposter)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
