PHP code example of prateekbhujel / larapost

1. Go to this page and download the library: Download prateekbhujel/larapost 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/ */

    

prateekbhujel / larapost example snippets


use SocialSync\Facades\SocialMedia;

$results = SocialMedia::post()
    ->content('We just shipped a new release.')
    ->platform('facebook')
    ->publish();

SocialMedia::post()
    ->content('Only these destinations')
    ->platform('facebook')
    ->accounts([
        'facebook' => [12, 19],
    ])
    ->publish();

SocialMedia::post()
    ->content('Tomorrow morning')
    ->platform('linkedin')
    ->scheduleFor(now()->addDay()->setTime(9, 0))
    ->publish();

SocialMedia::post()
    ->content('Process this through Laravel queues')
    ->platform('facebook')
    ->queue();

SocialMedia::post()
    ->content('Behind the scenes from launch day')
    ->video('https://media.example.com/launch.mp4')
    ->platform('tiktok')
    ->publish();

['web', 'auth']

use SocialSync\Facades\SocialMedia;

SocialMedia::extend('mastodon', App\Social\MastodonDriver::class);
bash
# Facebook only
php artisan larapost:install --platforms=facebook

# Facebook + TikTok
php artisan larapost:install --platforms=facebook,tiktok

# API/package usage without the built-in dashboard
php artisan larapost:install --platforms=linkedin --no-dashboard

# Prepare the optional MCP integration too
php artisan larapost:install --platforms=facebook,tiktok --mcp
bash
php artisan schedule:work
bash
php artisan larapost:doctor