PHPackages                             alihesari/larasap - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. alihesari/larasap

Abandoned → [owlstack/owlstack-laravel](/?search=owlstack%2Fowlstack-laravel)Library[Mail &amp; Notifications](/categories/mail)

alihesari/larasap
=================

Laravel social auto posting (Larasap) lets you automatically post all your content to social networks such as Telegram Channel, X (Twitter), and Facebook.

V1.2.3(7y ago)431458—0%112MITPHPPHP ~7.0CI passing

Since Dec 26Pushed 2mo ago23 watchersCompare

[ Source](https://github.com/alihesari/laravel-social-auto-posting)[ Packagist](https://packagist.org/packages/alihesari/larasap)[ RSS](/packages/alihesari-larasap/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (3)Versions (9)Used By (0)

 [   ![Owlstack](https://raw.githubusercontent.com/owlstacks/owlstack-docs/refs/heads/main/static/img/logo-dark-transparent.png)  ](https://owlstack.dev)

 **Laravel integration for social media publishing**

 [![Tests](https://camo.githubusercontent.com/35216595500c1ae31311af11c8c859826f5ca9e2d5b28c6f04ac49a59f28f44e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6f776c737461636b732f6f776c737461636b2d6c61726176656c2f74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265266c6162656c3d7465737473)](https://github.com/owlstacks/owlstack-laravel/actions/workflows/tests.yml) [![Latest Version](https://camo.githubusercontent.com/f5430e2523cdf17a246ef7f6a9bc1a933f210e0a0cc20dc260ec33d8dcb81f42/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f776c737461636b2f6f776c737461636b2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/owlstack/owlstack-laravel) [![Total Downloads](https://camo.githubusercontent.com/198bdd7ff206aa028d9bff4449692867ea5124662ceb2bfb02653f64c64e939b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f776c737461636b2f6f776c737461636b2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/owlstack/owlstack-laravel) [![PHP Version](https://camo.githubusercontent.com/0d0641bed7036eba431dbf5cd709281b2f2b4e94c5f540ec9a0e25b0503b52e7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6f776c737461636b2f6f776c737461636b2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/owlstack/owlstack-laravel) [![Laravel Version](https://camo.githubusercontent.com/b7b710b2ad15332b0829145adf77a85022a520a170f4c82769db1457b793506a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d31302e782532307c25323031312e782532307c25323031322e782d4646324432303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/owlstack/owlstack-laravel) [![License](https://camo.githubusercontent.com/dfb8347811a2dcaa1ca55188382cec37fc4a4c91c03afe0463de5f8c5f329440/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6f776c737461636b2f6f776c737461636b2d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](LICENSE) [![GitHub Stars](https://camo.githubusercontent.com/53c9187cea07a9e3a4306fe434a41fd9bde927d569ea7e08d339e9f62f51c444/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6f776c737461636b732f6f776c737461636b2d6c61726176656c3f7374796c653d666c61742d737175617265)](https://github.com/owlstacks/owlstack-laravel)

---

Owlstack for Laravel
====================

[](#owlstack-for-laravel)

Laravel integration for [Owlstack Core](https://github.com/owlstacks/owlstack-core) — publish content to **11 social media platforms** (Telegram, X/Twitter, Facebook, LinkedIn, Instagram, Discord, Slack, Reddit, Pinterest, WhatsApp, and Tumblr) from your Laravel application.

> **Note:** This package was previously `alihesari/larasap`. It has been rewritten from scratch to use `owlstack/owlstack-core` as its engine.

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10, 11, or 12

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

[](#installation)

```
composer require owlstack/owlstack-laravel
```

Publish the config file:

```
php artisan vendor:publish --tag=owlstack-config
```

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

[](#configuration)

Add your credentials to `.env`:

```
# Telegram
TELEGRAM_BOT_TOKEN=your-bot-token
TELEGRAM_BOT_USERNAME=your_bot
TELEGRAM_CHANNEL_USERNAME=@your_channel
TELEGRAM_CHANNEL_SIGNATURE=              # Optional footer signature
TELEGRAM_PARSE_MODE=HTML                  # HTML or Markdown

# X (Twitter)
TWITTER_CONSUMER_KEY=your-key
TWITTER_CONSUMER_SECRET=your-secret
TWITTER_ACCESS_TOKEN=your-token
TWITTER_ACCESS_TOKEN_SECRET=your-token-secret

# Facebook
FACEBOOK_APP_ID=your-app-id
FACEBOOK_APP_SECRET=your-app-secret
FACEBOOK_PAGE_ACCESS_TOKEN=your-page-token
FACEBOOK_PAGE_ID=your-page-id
FACEBOOK_GRAPH_VERSION=v21.0

# LinkedIn
LINKEDIN_ACCESS_TOKEN=your-access-token
LINKEDIN_PERSON_ID=your-person-id          # For personal posts
LINKEDIN_ORGANIZATION_ID=                   # For company page posts

# Reddit
REDDIT_CLIENT_ID=your-client-id
REDDIT_CLIENT_SECRET=your-client-secret
REDDIT_ACCESS_TOKEN=your-access-token
REDDIT_USERNAME=your-username

# Discord
DISCORD_BOT_TOKEN=your-bot-token
DISCORD_CHANNEL_ID=your-channel-id
DISCORD_WEBHOOK_URL=                        # Optional: use webhook instead

# Slack
SLACK_BOT_TOKEN=xoxb-your-token
SLACK_CHANNEL=#your-channel

# Instagram
INSTAGRAM_ACCESS_TOKEN=your-access-token
INSTAGRAM_ACCOUNT_ID=your-account-id

# Pinterest
PINTEREST_ACCESS_TOKEN=your-access-token
PINTEREST_BOARD_ID=your-board-id

# WhatsApp
WHATSAPP_ACCESS_TOKEN=your-access-token
WHATSAPP_PHONE_NUMBER_ID=your-phone-number-id

# Tumblr
TUMBLR_ACCESS_TOKEN=your-access-token
TUMBLR_BLOG_IDENTIFIER=your-blog.tumblr.com

# Proxy (optional — for restricted networks)
OWLSTACK_PROXY_HOST=localhost
OWLSTACK_PROXY_PORT=9050
OWLSTACK_PROXY_TYPE=7
```

Only platforms with valid credentials are registered. If you leave Twitter credentials empty, only Telegram and Facebook will be available.

Usage
-----

[](#usage)

### Via Dependency Injection (recommended)

[](#via-dependency-injection-recommended)

```
use Owlstack\Laravel\SendTo;

class PostController extends Controller
{
    public function publish(SendTo $sendTo)
    {
        // Telegram
        $result = $sendTo->telegram('Hello from Laravel!');

        // X (Twitter)
        $result = $sendTo->twitter('Hello from Laravel!');
        $result = $sendTo->x('Hello from Laravel!'); // alias

        // Facebook
        $result = $sendTo->facebook('Check this out!', 'link', [
            'link' => 'https://example.com',
        ]);

        // LinkedIn
        $result = $sendTo->linkedin('Post to LinkedIn!');

        // Discord
        $result = $sendTo->discord('Hello Discord!');

        // Slack
        $result = $sendTo->slack('Hello Slack!');

        // Reddit
        $result = $sendTo->reddit('Post body', [
            'title' => 'Post Title',
            'subreddit' => 'test',
        ]);

        // Instagram
        $result = $sendTo->instagram('Caption', [
            'path' => '/path/to/image.jpg',
            'mime_type' => 'image/jpeg',
        ]);

        // Pinterest
        $result = $sendTo->pinterest('Pin description', [
            'image' => '/path/to/image.jpg',
            'link' => 'https://example.com',
            'title' => 'Pin Title',
        ]);

        // WhatsApp
        $result = $sendTo->whatsapp('Hello!', ['to' => '+1234567890']);

        // Tumblr
        $result = $sendTo->tumblr('Blog post content');
    }
}
```

### Via Facade

[](#via-facade)

```
use Owlstack\Laravel\Facades\Owlstack;

Owlstack::telegram('Hello from the facade!');
Owlstack::twitter('Tweet from the facade!');
Owlstack::linkedin('Post from the facade!');
```

### Return Value

[](#return-value)

All methods return a `Owlstack\Core\Publishing\PublishResult`:

```
$result = $sendTo->telegram('Hello!');

$result->success;      // bool
$result->platformName; // 'telegram'
$result->externalId;   // '12345' (message ID)
$result->externalUrl;  // URL if available
$result->error;        // error message if failed
$result->failed();     // bool
```

### Telegram Features

[](#telegram-features)

```
// Text message
$sendTo->telegram('Simple text message');

// Photo with caption
$sendTo->telegram('Photo caption', [
    'type' => 'photo',
    'file' => '/path/to/image.jpg',
]);

// Video
$sendTo->telegram('Video caption', [
    'type' => 'video',
    'file' => '/path/to/video.mp4',
    'duration' => 120,
    'width' => 1920,
    'height' => 1080,
]);

// Audio
$sendTo->telegram('Audio caption', [
    'type' => 'audio',
    'file' => '/path/to/audio.mp3',
    'duration' => 200,
]);

// Document
$sendTo->telegram('Document caption', [
    'type' => 'document',
    'file' => '/path/to/file.pdf',
]);

// Voice message
$sendTo->telegram('', [
    'type' => 'voice',
    'file' => '/path/to/voice.ogg',
    'duration' => 15,
]);

// Location
$sendTo->telegram('', [
    'type' => 'location',
    'latitude' => 51.5074,
    'longitude' => -0.1278,
    'live_period' => 600, // optional
]);

// Venue
$sendTo->telegram('', [
    'type' => 'venue',
    'latitude' => 51.5074,
    'longitude' => -0.1278,
    'title' => 'Coffee Shop',
    'address' => '123 Main St',
]);

// Contact
$sendTo->telegram('', [
    'type' => 'contact',
    'phone_number' => '+1234567890',
    'first_name' => 'John',
    'last_name' => 'Doe',
]);

// Media group
$sendTo->telegram('Album caption', [
    'type' => 'media_group',
    'files' => [
        ['type' => 'photo', 'media' => '/path/to/img1.jpg'],
        ['type' => 'photo', 'media' => '/path/to/img2.jpg'],
    ],
]);

// Inline keyboard
$sendTo->telegram('Click below!', null, [
    [['text' => 'Visit', 'url' => 'https://example.com']],
]);
```

### Twitter / X Features

[](#twitter--x-features)

```
// Text tweet
$sendTo->twitter('Hello Twitter!');

// Tweet with media
$sendTo->twitter('Check this photo!', [
    'path' => '/path/to/image.jpg',
    'mime_type' => 'image/jpeg',
]);

// Multiple media
$sendTo->twitter('Multiple images!', [
    ['path' => '/path/to/img1.jpg', 'mime_type' => 'image/jpeg'],
    ['path' => '/path/to/img2.jpg', 'mime_type' => 'image/jpeg'],
]);
```

### Facebook Features

[](#facebook-features)

```
// Link post
$sendTo->facebook('Check this article!', 'link', [
    'link' => 'https://example.com/article',
]);

// Photo post
$sendTo->facebook('Beautiful photo!', 'photo', [
    'photo' => '/path/to/image.jpg',
]);

// Video post
$sendTo->facebook('Watch this!', 'video', [
    'video' => '/path/to/video.mp4',
    'title' => 'My Video',
    'description' => 'A great video.',
]);
```

### LinkedIn Features

[](#linkedin-features)

```
// Text post
$sendTo->linkedin('Hello LinkedIn!');

// Post with image
$sendTo->linkedin('Check out this image!', [
    'path' => '/path/to/image.jpg',
    'mime_type' => 'image/jpeg',
]);
```

### Discord Features

[](#discord-features)

```
// Text message
$sendTo->discord('Hello Discord!');

// Message with media
$sendTo->discord('Check this out!', [
    'path' => '/path/to/image.jpg',
    'mime_type' => 'image/jpeg',
]);
```

### Slack Features

[](#slack-features)

```
$sendTo->slack('Hello Slack!');
```

### Reddit Features

[](#reddit-features)

```
$sendTo->reddit('Post body text', [
    'title' => 'Post Title',
    'subreddit' => 'your_subreddit',
]);
```

### Instagram Features

[](#instagram-features)

```
$sendTo->instagram('Beautiful photo!', [
    'path' => '/path/to/image.jpg',
    'mime_type' => 'image/jpeg',
]);
```

### Pinterest Features

[](#pinterest-features)

```
$sendTo->pinterest('Pin description', [
    'image' => '/path/to/image.jpg',
    'link' => 'https://example.com',
    'title' => 'Pin Title',
]);
```

### WhatsApp Features

[](#whatsapp-features)

```
$sendTo->whatsapp('Hello!', ['to' => '+1234567890']);
```

### Tumblr Features

[](#tumblr-features)

```
// Text post
$sendTo->tumblr('Blog post content');

// Post with media
$sendTo->tumblr('Photo post', [
    'path' => '/path/to/image.jpg',
    'mime_type' => 'image/jpeg',
]);
```

### Using Post Objects Directly

[](#using-post-objects-directly)

For full control, create `Owlstack\Core\Content\Post` objects:

```
use Owlstack\Core\Content\Post;
use Owlstack\Core\Content\Media;
use Owlstack\Core\Content\MediaCollection;

$post = new Post(
    title: 'My Article',
    body: 'Full article body text...',
    url: 'https://example.com/article',
    tags: ['laravel', 'php'],
    media: new MediaCollection([
        new Media('/path/to/image.jpg', 'image/jpeg', altText: 'Article image'),
    ]),
);

// Publish to a specific platform
$result = $sendTo->publish($post, 'telegram');

// Publish to all configured platforms
$results = $sendTo->toAll($post);
// Returns: ['telegram' => PublishResult, 'twitter' => PublishResult, ...]
```

### Events

[](#events)

The package dispatches events through Laravel's event system:

- `Owlstack\Core\Events\PostPublished` — fired on successful publish
- `Owlstack\Core\Events\PostFailed` — fired on publish failure

```
// In EventServiceProvider or via Event::listen()
use Owlstack\Core\Events\PostPublished;
use Owlstack\Core\Events\PostFailed;

Event::listen(PostPublished::class, function (PostPublished $event) {
    Log::info("Published to {$event->result->platformName}", [
        'external_id' => $event->result->externalId,
    ]);
});

Event::listen(PostFailed::class, function (PostFailed $event) {
    Log::error("Failed to publish to {$event->result->platformName}", [
        'error' => $event->result->error,
    ]);
});
```

Architecture
------------

[](#architecture)

This package is a thin wrapper around `owlstack/owlstack-core`. The architecture:

```
Your Laravel App
    └── Owlstack\Laravel\SendTo (or Facade)
        └── Owlstack\Core\Publishing\Publisher
            └── Owlstack\Core\Platforms\{Telegram,Twitter,Facebook,LinkedIn,...}Platform
                └── Owlstack\Core\Http\HttpClient (cURL)

```

The service provider wires everything together:

- `OwlstackConfig` — built from `config/owlstack.php`
- `HttpClient` — core's cURL client (with optional proxy)
- Platform instances — only registered if credentials are configured
- `PlatformRegistry` — holds all active platforms
- `Publisher` — orchestrates publishing with event dispatch
- `SendTo` — high-level API bound as `'owlstack'` singleton

Testing
-------

[](#testing)

```
composer test
```

Or run PHPUnit directly:

In your own tests, mock `HttpClientInterface` on the container:

```
use Owlstack\Core\Http\Contracts\HttpClientInterface;

$mock = $this->createMock(HttpClientInterface::class);
$mock->method('post')->willReturn([
    'status' => 200,
    'headers' => [],
    'body' => json_encode(['ok' => true, 'result' => ['message_id' => 1]]),
]);

$this->app->instance(HttpClientInterface::class, $mock);
```

Migration from alihesari/larasap
--------------------------------

[](#migration-from-alihesarilarasap)

If upgrading from the old package:

1. Replace `alihesari/larasap` with `owlstack/owlstack-laravel` in `composer.json`
2. Rename `config/larasap.php` → `config/owlstack.php` (see new format above)
3. Replace `Alihesari\Larasap\SendTo` with `Owlstack\Laravel\SendTo`
4. Replace static calls (`SendTo::telegram(...)`) with DI or the new `Owlstack` facade
5. Update event listeners if you had custom ones
6. The `facebook/graph-sdk` and `facebook/php-business-sdk` dependencies are no longer needed

Key API changes:

- `SendTo::telegram($msg)` → `$sendTo->telegram($msg)` (instance method)
- `SendTo::x($msg)` → `$sendTo->x($msg)` or `$sendTo->twitter($msg)`
- `SendTo::facebook('link', $data)` → `$sendTo->facebook($msg, 'link', $data)`
- All methods now return `PublishResult` instead of raw arrays

License
-------

[](#license)

MIT

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance56

Moderate activity, may be stable

Popularity40

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 96.9% 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 ~376 days

Recently: every ~642 days

Total

8

Last Release

420d ago

Major Versions

V1.2.3 → 2.0.x-dev2025-03-16

PHP version history (2 changes)V1.0.0PHP ~7.0

2.0.x-devPHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/a7d6c137ddd414373cafbec4d67cb29e8b0e20802d9eb6b3331d9b501bcbe01b?d=identicon)[alihesari](/maintainers/alihesari)

---

Top Contributors

[![alihesari](https://avatars.githubusercontent.com/u/8302633?v=4)](https://github.com/alihesari "alihesari (123 commits)")[![karabayyazilim](https://avatars.githubusercontent.com/u/45515180?v=4)](https://github.com/karabayyazilim "karabayyazilim (2 commits)")[![SSEsmaeeli](https://avatars.githubusercontent.com/u/30143856?v=4)](https://github.com/SSEsmaeeli "SSEsmaeeli (2 commits)")

---

Tags

laravelfacebooktwittertelegramsocial network

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alihesari-larasap/health.svg)

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

###  Alternatives

[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[tzsk/sms

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

320244.3k6](/packages/tzsk-sms)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)

PHPackages © 2026

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