<?php
$file = __DIR__ . '/../vendor/filament/filament/resources/views/components/header/index.blade.php';
if (file_exists($file)) {
    echo file_get_contents($file);
} else {
    // Search in vendor/filament/
    $dir = new RecursiveDirectoryIterator(__DIR__ . '/../vendor/filament');
    $iterator = new RecursiveIteratorIterator($dir);
    foreach ($iterator as $f) {
        if ($f->isFile() && str_ends_with($f->getPathname(), 'header/index.blade.php')) {
            echo "Found in: " . $f->getPathname() . "\n";
            echo file_get_contents($f->getPathname());
            break;
        }
    }
}
