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

28 lines
550 B
PHP
Raw Normal View History

2025-06-29 21:33:18 +02:00
<?php
namespace App\Console\Commands;
use App\Models\Article;
use App\Services\Article\ArticleFetcher;
use Illuminate\Console\Command;
class FetchArticleCommand extends Command
{
protected $signature = 'article:fetch {url}';
protected $description = 'Fetch article from url';
public function handle(): int
{
$article = Article::createQuietly([
'url' => $this->argument('url'),
]);
$res = ArticleFetcher::fetchArticleData($article);
dump($res);
return self::SUCCESS;
}
}