This commit is contained in:
myrmidex 2025-06-29 15:55:06 +02:00
parent 2b05bef5b6
commit 3b04e2d234
4 changed files with 12 additions and 6 deletions

3
.env
View file

@ -4,6 +4,9 @@ APP_KEY=base64:2cskqsDdzSN+zMt3p+b9AJlGQf+HImWbQ4wSXdNy65Y=
APP_DEBUG=true APP_DEBUG=true
APP_URL=http://localhost APP_URL=http://localhost
WWWWUSER=1000
WWWGROUP
APP_LOCALE=en APP_LOCALE=en
APP_FALLBACK_LOCALE=en APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US APP_FAKER_LOCALE=en_US

View file

@ -15,13 +15,14 @@ public function __construct()
public function handle(ArticleFetched $event): void public function handle(ArticleFetched $event): void
{ {
logger('Checking keywords for article: ' . $event->article->id); logger('Checking keywords for article: ' . $event->article->id);
// TODO: Add actual keyword checking logic here // TODO: Add actual keyword checking logic here
// For now, mark all articles as relevant // For now, mark all articles as relevant
$isRelevant = true; $isRelevant = true;
$event->article->update(['is_relevant' => $isRelevant]); $event->article->update(['is_relevant' => $isRelevant]);
if ($isRelevant) { if ($isRelevant) {
event(new ArticleReadyToPublish($event->article)); event(new ArticleReadyToPublish($event->article));
} }

View file

@ -13,7 +13,9 @@ public function __construct()
public function handle(ArticleReadyToPublish $event): void public function handle(ArticleReadyToPublish $event): void
{ {
logger('Publishing article: ' . $event->article->id); $article = $event->article;
logger('Publishing article: ' . $article->id . ' : ' . $article->url);
// TODO: Add actual publishing logic here // TODO: Add actual publishing logic here
} }
} }

View file

@ -3,4 +3,4 @@
use App\Console\Commands\FetchNewArticlesCommand; use App\Console\Commands\FetchNewArticlesCommand;
use Illuminate\Support\Facades\Schedule; use Illuminate\Support\Facades\Schedule;
Schedule::command(FetchNewArticlesCommand::class)->hourly(); Schedule::command(FetchNewArticlesCommand::class)->everyMinute();