Implement tenant announcements and audit log fixes
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-02 14:19:46 +01:00
parent 412ecbe691
commit 8f13465415
33 changed files with 1400 additions and 117 deletions

View File

@@ -311,32 +311,18 @@ class MarketingController extends Controller
public function blogIndex(Request $request, string $locale)
{
$locale = $locale ?: app()->getLocale();
Log::info('Blog Index Debug - Initial', [
'locale' => $locale,
'full_url' => $request->fullUrl(),
]);
$query = BlogPost::query()
->with('author')
->whereHas('category', function ($query) {
$query->where('slug', 'blog');
});
$totalWithCategory = $query->count();
Log::info('Blog Index Debug - With Category', ['count' => $totalWithCategory]);
$query->where('is_published', true)
->whereNotNull('published_at')
->where('published_at', '<=', now());
$totalPublished = $query->count();
Log::info('Blog Index Debug - Published', ['count' => $totalPublished]);
// Removed translation filter for now
$totalWithTranslation = $query->count();
Log::info('Blog Index Debug - With Translation', ['count' => $totalWithTranslation, 'locale' => $locale]);
$posts = $query->orderBy('published_at', 'desc')
->paginate(4)
->through(function (BlogPost $post) use ($locale) {
@@ -354,13 +340,6 @@ class MarketingController extends Controller
];
});
Log::info('Blog Index Debug - Final Posts', [
'count' => $posts->count(),
'total' => $posts->total(),
'posts_data' => $posts->toArray(),
'first_post_title' => $posts->count() > 0 ? ($posts->first()['title'] ?? 'No title') : 'No posts',
]);
$postsArray = $posts->toArray();
$postsArray['links'] = array_map(function (array $link) use ($locale) {
return [