2025-06-29 09:37:49 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
|
|
2025-06-29 17:46:06 +02:00
|
|
|
use App\Services\Article\ArticleFetcher;
|
2025-06-29 09:37:49 +02:00
|
|
|
use Illuminate\Console\Command;
|
|
|
|
|
|
|
|
|
|
class FetchNewArticlesCommand extends Command
|
|
|
|
|
{
|
2025-06-30 18:18:30 +02:00
|
|
|
protected $signature = 'article:refresh';
|
2025-06-29 09:37:49 +02:00
|
|
|
|
2025-06-30 18:18:30 +02:00
|
|
|
protected $description = 'Fetches latest articles';
|
2025-06-29 09:37:49 +02:00
|
|
|
|
|
|
|
|
public function handle(): int
|
|
|
|
|
{
|
|
|
|
|
logger('Fetch new articles command');
|
|
|
|
|
|
|
|
|
|
ArticleFetcher::getNewArticles();
|
|
|
|
|
|
|
|
|
|
return self::SUCCESS;
|
|
|
|
|
}
|
|
|
|
|
}
|