fedi-feed-router/app/Console/Commands/PublishToLemmyCommand.php

24 lines
470 B
PHP
Raw Normal View History

2025-06-29 20:16:25 +02:00
<?php
namespace App\Console\Commands;
use App\Models\Article;
use App\Services\Article\LemmyService;
use Illuminate\Console\Command;
class PublishToLemmyCommand extends Command
{
protected $signature = 'article:publish-to-lemmy';
protected $description = 'Publish an article to Lemmy';
public function handle(): int
{
$article = Article::all()->firstOrFail();
LemmyService::publish($article);
return self::SUCCESS;
}
}