WIP
This commit is contained in:
parent
2b05bef5b6
commit
3b04e2d234
4 changed files with 12 additions and 6 deletions
3
.env
3
.env
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue