# ============================================================ # FIX: BOM + Encoding issue in all generated PHP files # Project root mein run karo # ============================================================ Write-Host "Fixing BOM and encoding issues..." -ForegroundColor Yellow $files = Get-ChildItem -Path "app\Filament\Admin" -Recurse -Filter "*.php" $fixed = 0 $skipped = 0 foreach ($file in $files) { $bytes = [System.IO.File]::ReadAllBytes($file.FullName) # Check for BOM (EF BB BF) $hasBom = ($bytes.Length -ge 3 -and $bytes[0] -eq 0xEF -and $bytes[1] -eq 0xBB -and $bytes[2] -eq 0xBF) if ($hasBom) { # Remove BOM $noBomBytes = $bytes[3..($bytes.Length - 1)] [System.IO.File]::WriteAllBytes($file.FullName, $noBomBytes) Write-Host " [FIXED BOM] $($file.FullName)" -ForegroundColor Green $fixed++ } else { $skipped++ } } Write-Host "" Write-Host "Fixed: $fixed files | Skipped (ok): $skipped files" -ForegroundColor Cyan Write-Host "" Write-Host "Ab run karo:" -ForegroundColor Yellow Write-Host " php artisan optimize:clear" -ForegroundColor Green