PHPackages                             limonhasan/social-autoposter - 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. limonhasan/social-autoposter

ActiveLibrary

limonhasan/social-autoposter
============================

Laravel social media auto post package - Complete solution for posting to 8 major social media platforms with advanced scheduling and analytics

1.5.0(4mo ago)11MITPHPPHP ^7.4|^8.0

Since Jan 3Pushed 4mo agoCompare

[ Source](https://github.com/limonhassan606/SocialAutoPoster)[ Packagist](https://packagist.org/packages/limonhasan/social-autoposter)[ RSS](/packages/limonhasan-social-autoposter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Laravel Social Auto Poster
==========================

[](#laravel-social-auto-poster)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5c0d9908d21c7aefac3722dbe44f9d64d500656ffe3edada63d2d80ad972f243/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c696d6f6e686173616e2f736f6369616c2d6175746f706f737465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/limonhasan/social-autoposter)[![Total Downloads](https://camo.githubusercontent.com/6339cd12b43853234b4e72ceb68ed828377730745baf4e04098ac804ad442cd3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c696d6f6e686173616e2f736f6369616c2d6175746f706f737465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/limonhasan/social-autoposter)[![License](https://camo.githubusercontent.com/25d7678baf8d91f7a10e560f91ac7e12235e2767da67274af4e049e39dac289b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c696d6f6e686173616e2f736f6369616c2d6175746f706f737465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/limonhasan/social-autoposter)[![PHP Version](https://camo.githubusercontent.com/6bf56ff5b8965235f8d1cc00880466fc48b71c8ff1fe662ab75992ee9d20ebbf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6c696d6f6e686173616e2f736f6369616c2d6175746f706f737465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/limonhasan/social-autoposter)

A comprehensive Laravel package for automatic social media posting across **8 major platforms**: Facebook, Twitter/X, LinkedIn, Instagram, TikTok, YouTube, Pinterest, and Telegram. Post to one platform or all platforms simultaneously with a unified API.

🌟 Features
----------

[](#-features)

- **8 Social Media Platforms**: Facebook, Twitter/X, LinkedIn, Instagram, TikTok, YouTube, Pinterest, Telegram
- **Unified API**: Post to multiple platforms with a single command
- **Individual Platform Access**: Direct access to each platform's specific features
- **Comprehensive Content Types**: Text, Images, Videos, Documents, Stories, Carousels
- **Advanced Analytics**: Facebook Page Insights, Twitter Analytics, LinkedIn Metrics
- **Production Ready**: Error handling, retry logic, rate limiting, logging
- **Laravel Native**: Perfect integration with Laravel ecosystem
- **Extensible**: Easy to add new platforms and features

📋 Table of Contents
-------------------

[](#-table-of-contents)

- [Installation](#installation)
- [Configuration](#configuration)
- [Quick Start](#quick-start)
- [Usage](#usage)
    - [Unified API](#unified-api)
    - [Individual Platforms](#individual-platforms)
    - [Platform-Specific Features](#platform-specific-features)
- [Advanced Features](#advanced-features)
- [Error Handling](#error-handling)
- [Testing](#testing)
- [Examples](#examples)
- [API Reference](#api-reference)
- [Contributing](#contributing)
- [License](#license)

🚀 Installation
--------------

[](#-installation)

### Requirements

[](#requirements)

- **PHP**: 7.4, 8.0, 8.1, 8.2, or 8.3
- **Laravel**: 7.x, 8.x, 9.x, 10.x, 11.x, or 12.x
- **Composer**

### Install via Composer

[](#install-via-composer)

```
composer require limonhasan/social-autoposter
```

### Publish Configuration

[](#publish-configuration)

```
php artisan vendor:publish --provider="LimonHasan\SocialAutoPoster\SocialShareServiceProvider" --tag=autopost
```

⚙️ Configuration
----------------

[](#️-configuration)

### Environment Variables

[](#environment-variables)

Add the following environment variables to your `.env` file:

```
# Facebook
FACEBOOK_ACCESS_TOKEN=your_facebook_access_token
FACEBOOK_PAGE_ID=your_facebook_page_id

# Twitter/X
TWITTER_BEARER_TOKEN=your_twitter_bearer_token
TWITTER_API_KEY=your_twitter_api_key
TWITTER_API_SECRET=your_twitter_api_secret
TWITTER_ACCESS_TOKEN=your_twitter_access_token
TWITTER_ACCESS_TOKEN_SECRET=your_twitter_access_token_secret

# LinkedIn
LINKEDIN_ACCESS_TOKEN=your_linkedin_access_token
LINKEDIN_PERSON_URN=your_linkedin_person_urn
LINKEDIN_ORGANIZATION_URN=your_linkedin_organization_urn

# Instagram
INSTAGRAM_ACCESS_TOKEN=your_instagram_access_token
INSTAGRAM_ACCOUNT_ID=your_instagram_account_id

# TikTok
TIKTOK_ACCESS_TOKEN=your_tiktok_access_token
TIKTOK_CLIENT_KEY=your_tiktok_client_key
TIKTOK_CLIENT_SECRET=your_tiktok_client_secret

# YouTube
YOUTUBE_API_KEY=your_youtube_api_key
YOUTUBE_ACCESS_TOKEN=your_youtube_access_token
YOUTUBE_CHANNEL_ID=your_youtube_channel_id

# Pinterest
PINTEREST_ACCESS_TOKEN=your_pinterest_access_token
PINTEREST_BOARD_ID=your_pinterest_board_id

# Telegram
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
TELEGRAM_CHAT_ID=your_telegram_chat_id
```

### Configuration File

[](#configuration-file)

The published `config/autopost.php` file contains all configuration options:

```
return [
    // Platform configurations
    'facebook_access_token' => env('FACEBOOK_ACCESS_TOKEN'),
    'facebook_page_id' => env('FACEBOOK_PAGE_ID'),
    'facebook_api_version' => env('FACEBOOK_API_VERSION', 'v20.0'),

    // ... other platform configurations

    // General settings
    'default_platforms' => ['facebook', 'twitter', 'linkedin'],
    'enable_logging' => env('SOCIAL_MEDIA_LOGGING', true),
    'timeout' => env('SOCIAL_MEDIA_TIMEOUT', 30),
    'retry_attempts' => env('SOCIAL_MEDIA_RETRY_ATTEMPTS', 3),
];
```

🎯 Quick Start
-------------

[](#-quick-start)

### Basic Usage

[](#basic-usage)

```
use LimonHasan\SocialAutoPoster\Facades\SocialMedia;

// Post to multiple platforms
$result = SocialMedia::share(['facebook', 'twitter', 'linkedin'], 'Hello World!', 'https://example.com');

// Post to all platforms
$result = SocialMedia::shareToAll('Hello World!', 'https://example.com');

// Share images
$result = SocialMedia::shareImage(['instagram', 'pinterest'], 'Check this out!', 'https://example.com/image.jpg');

// Share videos
$result = SocialMedia::shareVideo(['youtube', 'tiktok'], 'Watch this!', 'https://example.com/video.mp4');
```

### Individual Platform Access

[](#individual-platform-access)

```
use LimonHasan\SocialAutoPoster\Facades\FaceBook;
use LimonHasan\SocialAutoPoster\Facades\Twitter;
use LimonHasan\SocialAutoPoster\Facades\LinkedIn;

// Facebook
FaceBook::share('Hello Facebook!', 'https://example.com');
FaceBook::shareImage('Check this image!', 'https://example.com/image.jpg');

// Twitter
Twitter::share('Hello Twitter!', 'https://example.com');
Twitter::shareImage('Check this image!', 'https://example.com/image.jpg');

// LinkedIn
LinkedIn::share('Hello LinkedIn!', 'https://example.com');
LinkedIn::shareToCompanyPage('Company update!', 'https://example.com');
```

📖 Usage
-------

[](#-usage)

### Unified API

[](#unified-api)

The `SocialMedia` facade provides a unified interface for posting to multiple platforms:

#### Share to Multiple Platforms

[](#share-to-multiple-platforms)

```
use SocialMedia;

// Post to specific platforms
$result = SocialMedia::share(['facebook', 'twitter', 'linkedin'], 'Content', 'https://example.com');

// Share images to visual platforms
$result = SocialMedia::shareImage(['instagram', 'pinterest'], 'Caption', 'https://example.com/image.jpg');

// Share videos to video platforms
$result = SocialMedia::shareVideo(['youtube', 'tiktok'], 'Caption', 'https://example.com/video.mp4');
```

#### Share to All Platforms

[](#share-to-all-platforms)

```
// Post to all available platforms
$result = SocialMedia::shareToAll('Content', 'https://example.com');

// Share images to all platforms
$result = SocialMedia::shareImageToAll('Caption', 'https://example.com/image.jpg');

// Share videos to all platforms
$result = SocialMedia::shareVideoToAll('Caption', 'https://example.com/video.mp4');
```

#### Platform-Specific Access

[](#platform-specific-access)

```
// Access individual platforms
$facebookService = SocialMedia::facebook();
$twitterService = SocialMedia::twitter();
$linkedinService = SocialMedia::linkedin();

// Use platform-specific methods
$result = SocialMedia::linkedin()->shareToCompanyPage('Content', 'https://example.com');
$result = SocialMedia::instagram()->shareCarousel('Caption', ['img1.jpg', 'img2.jpg']);
```

### Individual Platforms

[](#individual-platforms)

Each platform has its own facade with specific methods:

#### Facebook

[](#facebook)

```
use FaceBook;

// Basic posting
FaceBook::share('Content', 'https://example.com');
FaceBook::shareImage('Caption', 'https://example.com/image.jpg');
FaceBook::shareVideo('Caption', 'https://example.com/video.mp4');

// Analytics
$insights = FaceBook::getPageInsights(['page_impressions', 'page_engaged_users']);
$pageInfo = FaceBook::getPageInfo();
```

#### Twitter/X

[](#twitterx)

```
use Twitter;

// Posting
Twitter::share('Content', 'https://example.com');
Twitter::shareImage('Caption', 'https://example.com/image.jpg');
Twitter::shareVideo('Caption', 'https://example.com/video.mp4');

// Analytics
$timeline = Twitter::getTimeline(10);
$userInfo = Twitter::getUserInfo();
```

#### LinkedIn

[](#linkedin)

```
use LinkedIn;

// Personal posts
LinkedIn::share('Content', 'https://example.com');
LinkedIn::shareImage('Caption', 'https://example.com/image.jpg');
LinkedIn::shareVideo('Caption', 'https://example.com/video.mp4');

// Company page posts
LinkedIn::shareToCompanyPage('Content', 'https://example.com');

// User info
$userInfo = LinkedIn::getUserInfo();
```

#### Instagram

[](#instagram)

```
use Instagram;

// Posts
Instagram::shareImage('Caption', 'https://example.com/image.jpg');
Instagram::shareVideo('Caption', 'https://example.com/video.mp4');

// Carousel posts
Instagram::shareCarousel('Caption', ['img1.jpg', 'img2.jpg', 'img3.jpg']);

// Stories
Instagram::shareStory('Caption', 'https://example.com');

// Analytics
$accountInfo = Instagram::getAccountInfo();
$recentMedia = Instagram::getRecentMedia(25);
```

#### TikTok

[](#tiktok)

```
use TikTok;

// Video posting
TikTok::shareVideo('Caption', 'https://example.com/video.mp4');

// Analytics
$userInfo = TikTok::getUserInfo();
$userVideos = TikTok::getUserVideos(20);
```

#### YouTube

[](#youtube)

```
use YouTube;

// Video uploads
YouTube::shareVideo('Title', 'https://example.com/video.mp4');

// Community posts
YouTube::createCommunityPost('Content', 'https://example.com');

// Analytics
$channelInfo = YouTube::getChannelInfo();
$channelVideos = YouTube::getChannelVideos(25);
$videoAnalytics = YouTube::getVideoAnalytics('video_id');
```

#### Pinterest

[](#pinterest)

```
use Pinterest;

// Pins
Pinterest::shareImage('Caption', 'https://example.com/image.jpg');
Pinterest::shareVideo('Caption', 'https://example.com/video.mp4');

// Boards
Pinterest::createBoard('Board Name', 'Description');

// Analytics
$userInfo = Pinterest::getUserInfo();
$boards = Pinterest::getBoards(25);
$boardPins = Pinterest::getBoardPins('board_id', 25);
$pinAnalytics = Pinterest::getPinAnalytics('pin_id');
```

#### Telegram

[](#telegram)

```
use Telegram;

// Messages
Telegram::share('Content', 'https://example.com');
Telegram::shareImage('Caption', 'https://example.com/image.jpg');
Telegram::shareVideo('Caption', 'https://example.com/video.mp4');
Telegram::shareDocument('Caption', 'https://example.com/document.pdf');

// Bot updates
$updates = Telegram::getUpdates();
```

🔧 Advanced Features
-------------------

[](#-advanced-features)

### Error Handling

[](#error-handling)

The package provides comprehensive error handling:

```
use LimonHasan\SocialAutoPoster\Exceptions\SocialMediaException;

try {
    $result = SocialMedia::share(['facebook', 'twitter'], 'Content', 'https://example.com');

    // Check results
    if ($result['error_count'] > 0) {
        foreach ($result['errors'] as $platform => $error) {
            echo "Error on {$platform}: {$error}\n";
        }
    }

} catch (SocialMediaException $e) {
    echo "Social media error: " . $e->getMessage();
}
```

### Retry Logic

[](#retry-logic)

The package automatically retries failed requests with exponential backoff:

```
// Configure retry attempts
config(['autopost.retry_attempts' => 5]);

// Configure timeout
config(['autopost.timeout' => 60]);
```

### Logging

[](#logging)

All operations are automatically logged:

```
// Enable/disable logging
config(['autopost.enable_logging' => true]);

// Check Laravel logs for detailed information
tail -f storage/logs/laravel.log
```

🧪 Testing
---------

[](#-testing)

### Run Tests

[](#run-tests)

```
# Run all tests
./vendor/bin/phpunit

# Run specific test suite
./vendor/bin/phpunit tests/Unit/
./vendor/bin/phpunit tests/Feature/

# Run with coverage
./vendor/bin/phpunit --coverage-html coverage/
```

📄 License
---------

[](#-license)

This package is licensed under the [MIT License](LICENSE).

🆘 Support
---------

[](#-support)

- **Documentation**: [GitHub Wiki](https://github.com/limonhassan606/social-autoposter/wiki)
- **Issues**: [GitHub Issues](https://github.com/limonhassan606/social-autoposter/issues)
- **Email**:
- **Portfolio**:

🙏 Acknowledgments
-----------------

[](#-acknowledgments)

- Laravel Framework
- All social media platform APIs
- The open-source community

---

**Made with ❤️ by [Limon Hasan](https://limon.qzz.io)**

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance77

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

128d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6da519fbf0b1bdfe696583922d442dd596f830592653285befcbfd064570db55?d=identicon)[limonhasan](/maintainers/limonhasan)

---

Top Contributors

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

---

Tags

laravel-social-media-autosocial-media-auto-post

### Embed Badge

![Health badge](/badges/limonhasan-social-autoposter/health.svg)

```
[![Health](https://phpackages.com/badges/limonhasan-social-autoposter/health.svg)](https://phpackages.com/packages/limonhasan-social-autoposter)
```

PHPackages © 2026

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