$file->getExtension() === 'svg'); $enumContent = "getFilename(), PATHINFO_FILENAME); // Letter V is duplicate, as "letter-v" and "letter-letter-v" if (str($filename)->contains('letter-letter')) { continue; } // Filled icons exist with "-f" and "-filled", we only want the later if (str($filename)->endsWith('-f') && file_exists(base_path("vendor/secondnetwork/blade-tabler-icons/resources/svg/{$filename}illed.svg"))) { continue; } $caseName = str($filename)->title()->replace('-', ''); $value = str($filename)->slug()->prepend('tabler-'); $enumContent .= " case $caseName = '$value';\n"; } $enumContent .= "}\n"; File::put(base_path('app/Enums/TablerIcon.php'), $enumContent); $this->info('Enum generated'); } }