feat: cron

This commit is contained in:
2026-05-18 20:32:32 +02:00
parent 19d106a3ed
commit f5a3e79c8a
16 changed files with 547 additions and 9 deletions
@@ -0,0 +1,31 @@
<?php
namespace App\Console\Commands;
use App\Services\AiMealPostGenerator;
use Illuminate\Console\Command;
use Throwable;
class GenerateAiMealPost extends Command
{
protected $signature = 'meal-posts:generate-ai';
protected $description = 'Generate one AI meal post with an image.';
public function handle(AiMealPostGenerator $generator): int
{
try {
$mealPost = $generator->generate();
} catch (Throwable $exception) {
report($exception);
$this->error('Impossible de generer le repas IA.');
return self::FAILURE;
}
$this->info("Repas IA genere: {$mealPost->title} ({$mealPost->getKey()})");
return self::SUCCESS;
}
}