@php $rf_rotation_month = strtolower(date('F')); $rf_rotation_prefix = "device_rotation_warnings/{$rf_rotation_month}"; $rf_rotation_files = collect(\Illuminate\Support\Facades\Storage::disk('public')->files($rf_rotation_prefix)) ->filter(fn($f) => preg_match('/\.(webp|png|jpg|jpeg|gif)$/i', $f)) ->values() ->all(); $rf_rotation_urls = array_map(fn($f) => '/storage/' . $f, $rf_rotation_files); $rf_rotation_image = count($rf_rotation_urls) > 0 ? $rf_rotation_urls[array_rand($rf_rotation_urls)] : null; @endphp