- Create twitter-post sidecar with Playwright for browser automation - Create linkedin-post sidecar with Playwright for browser automation - Add TwitterPublisher class that calls twitter-post sidecar - Add LinkedInPublisher class that calls linkedin-post sidecar - Register both publishers in PublisherManager via AppServiceProvider - Update Posts index view to show Publish button for twitter/linkedin types Both publishers use the same pattern as RedditPublisher: - No API keys required (uses stored credentials from Social Accounts) - Browser automation via Playwright - Returns JSON result with success/failure and URL Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
35 lines
879 B
PHP
35 lines
879 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Support\Publishing\LinkedInPublisher;
|
|
use App\Support\Publishing\PublisherManager;
|
|
use App\Support\Publishing\RedditPublisher;
|
|
use App\Support\Publishing\TwitterPublisher;
|
|
use App\Support\Publishing\WordPressPublisher;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
$this->app->singleton(PublisherManager::class, fn ($app) => new PublisherManager([
|
|
$app->make(WordPressPublisher::class),
|
|
$app->make(RedditPublisher::class),
|
|
$app->make(TwitterPublisher::class),
|
|
$app->make(LinkedInPublisher::class),
|
|
]));
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
//
|
|
}
|
|
}
|