1. Go to this page and download the library: Download owlstack/owlstack-laravel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Owlstack\Laravel\Facades\Owlstack;
Owlstack::telegram('Hello from the facade!');
Owlstack::twitter('Tweet from the facade!');
Owlstack::linkedin('Post from the facade!');
$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
// 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'],
]);
// 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.',
]);
// Text post
$sendTo->linkedin('Hello LinkedIn!');
// Post with image
$sendTo->linkedin('Check out this image!', [
'path' => '/path/to/image.jpg',
'mime_type' => 'image/jpeg',
]);
// Text message
$sendTo->discord('Hello Discord!');
// Message with media
$sendTo->discord('Check this out!', [
'path' => '/path/to/image.jpg',
'mime_type' => 'image/jpeg',
]);
// Text post
$sendTo->tumblr('Blog post content');
// Post with media
$sendTo->tumblr('Photo post', [
'path' => '/path/to/image.jpg',
'mime_type' => 'image/jpeg',
]);
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, ...]
// 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,
]);
});