wip: article AI polish, category SEO fields, cover generator, membership plan seeder
CI / PHPUnit (PHP 8.3) (push) Failing after 4s
CI / PHPUnit (PHP 8.2) (push) Failing after 1m9s
CI / Deploy (manual gate) (push) Skipped

This commit is contained in:
2026-09-07 18:48:37 +00:00
parent 263b98b218
commit 3cec4c5e18
121 changed files with 4701 additions and 313 deletions
@@ -34,15 +34,27 @@ class OptimizeArticleContentJob implements ShouldQueue
}
try {
$result = $llm->complete($article->content, [
$result = $llm->complete((string) $article->content, [
'title' => $article->title,
'article_id' => $article->id,
'content_format' => $article->content_format,
]);
$article->forceFill([
'ai_summary' => $result['summary'] ?? null,
'ai_suggestions' => $result['suggestions'] ?? [],
])->save();
$updates = [
'ai_summary' => filled($result['summary'] ?? null) ? (string) $result['summary'] : $article->ai_summary,
'ai_suggestions' => array_values($result['suggestions'] ?? []),
];
if (filled($result['polished_content'] ?? null)) {
$updates['ai_polished_content'] = (string) $result['polished_content'];
}
// Fill empty SEO description from the model when the author left it blank.
if (blank($article->description) && filled($result['description'] ?? null)) {
$updates['description'] = (string) $result['description'];
}
$article->forceFill($updates)->save();
} catch (\Throwable $exception) {
Log::warning('Article content optimization failed.', [
'article_id' => $this->articleId,