# PowerShell script to convert admin views from to universal layout # Get all admin blade files that contain $adminFiles = Get-ChildItem -Path "resources\views\admin" -Filter "*.blade.php" -Recurse | Where-Object { (Get-Content $_.FullName -Raw) -match '' } Write-Host "Found $($adminFiles.Count) files to convert:" foreach ($file in $adminFiles) { Write-Host "Converting: $($file.FullName)" $content = Get-Content $file.FullName -Raw # Skip if already converted (contains @extends) if ($content -match '@extends\(') { Write-Host " - Already converted, skipping" continue } # Extract title from header slot if present $title = "Admin" if ($content -match ']*>.*?\{\{\s*__\([''"]([^''"]*)[''"].*?') { $title = $matches[1] } elseif ($content -match ']*>([^<]*)') { $title = $matches[1].Trim() } # Create new content with universal layout $newContent = "@extends('layouts.app-universal') @section('title', '$title') @section('content')

$title

This page needs manual conversion from Tailwind to Bootstrap classes.
" # Extract main content between
and if ($content -match '(?s)
(.*?)') { $mainContent = $matches[1] # Remove outer containers and replace with bootstrap structure $mainContent = $mainContent -replace '(?s)
]*>', '' $mainContent = $mainContent -replace '(?s)
]*>', '' $mainContent = $mainContent -replace '
\s*
\s*
\s*$', '' $newContent += $mainContent } else { # Fallback: just remove x-app-layout tags $contentBody = $content -replace '(?s).*?', '' $contentBody = $contentBody -replace '', '' $contentBody = $contentBody -replace '', '' $newContent += $contentBody } $newContent += "
@endsection" # Write the new content Set-Content -Path $file.FullName -Value $newContent -Encoding UTF8 Write-Host " - Converted successfully" } Write-Host "Conversion completed!" Write-Host "Note: Manual review required to convert Tailwind classes to Bootstrap"