@php $stats = \App\Models\Statistic::where('is_published', true) ->orderBy('display_order') ->get() ->map(function ($stat) { // Admin enters the whole thing as one free-text string (e.g. // "100,000+", "24/7") — split off the leading number so it can // still drive the counter animation, keeping the trailing part // (+, /7, etc.) as static suffix text exactly as before. preg_match('/^([\d,]+)(.*)$/', trim($stat->number), $m); return [ 'count' => isset($m[1]) ? (int) str_replace(',', '', $m[1]) : 0, 'suffix' => $m[2] ?? $stat->number, 'label' => $stat->name, 'icon' => $stat->icon, ]; }); @endphp @if ($stats->isNotEmpty())
@foreach ($stats as $i => $stat)

0{{ $stat['suffix'] }}

{{ $stat['label'] }}

@endforeach
@endif