@php $topPosts = $topPosts ?? []; $maxEngagement = collect($topPosts)->max('total_engagement') ?: 1; @endphp @if (count($topPosts) > 0)

Top publications

Classees par vues et interactions sur la periode.

@foreach ($topPosts as $index => $row) @php $post = $row['post']; $pct = min(100, round(($row['total_engagement'] / $maxEngagement) * 100)); @endphp

#{{ $index + 1 }}

{{ $post->excerpt(80) }}

{{ $post->published_at?->format('d/m/Y H:i') ?: '-' }}

{{ number_format($row['media_views'], 0, ',', ' ') }} vues

{{ number_format($row['total_engagement'], 0, ',', ' ') }} interactions

{{ number_format($row['engagement_rate'], 1, ',', ' ') }} % engagement

@if ($post->permalink_url) Voir sur Facebook @endif
@endforeach
@endif