'; $gridMarker = '
'; $posStart = strpos($content, $startMarker); $posGrid = strpos($content, $gridMarker); if ($posStart !== false && $posGrid !== false) { // We want to remove everything from $startMarker up to (but not including) $gridMarker // And replace it with our main grid start $header = substr($content, 0, $posStart); $newStart = '
'; $remaining = substr($content, $posGrid + strlen($gridMarker)); // We also need to change the split for the right column. // The left column ends and the right column starts somewhere. // Let's find "" or where the left div ends. $newContent = $header . $newStart . $remaining; file_put_contents('/Users/ahmeddarrazi/Documents/projects/wt-plattform/apps/platform/resources/views/filament/widgets/dashboard/tenant-dashboard-overview.blade.php', $newContent); echo "Replaced top section\n"; } else { echo "Markers not found\n"; }