PHP code example of itmosoft / laravel-social-publishing
1. Go to this page and download the library: Download itmosoft/laravel-social-publishing 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/ */
itmosoft / laravel-social-publishing example snippets
namespace App\Social;
use ItmoSoft\SocialPublishing\Contracts\SocialPlatformPublisher;
use ItmoSoft\SocialPublishing\Models\SocialAccount;
use ItmoSoft\SocialPublishing\Models\SocialPost;
class ExamplePlatformPublisher implements SocialPlatformPublisher
{
public function publish(SocialAccount $account, SocialPost $post): array
{
// Call the provider SDK/API here.
// Return provider response data, including its external post ID.
return ['id' => 'provider-post-id'];
}
}
use ItmoSoft\SocialPublishing\Contracts\SocialPlatformPublisher;
$publication = $manager->publish(
$post,
$account,
app(SocialPlatformPublisher::class),
);