@php use Carbon\Carbon; use Illuminate\Support\Str; $months = collect(range(1, 12)) // 1 to 12 instead of 0 to 11 ->map(fn($i) => Carbon::now()->subMonths($i)->format('F-Y')) ->reverse(); @endphp