Implement tenant announcements and audit log fixes
This commit is contained in:
@@ -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 [
|
||||
|
||||
Reference in New Issue
Block a user