blade-ui-kit / blade-heroicons

A package to easily make use of Heroicons in your Laravel Blade views.
https://blade-ui-kit.com/blade-icons
MIT License
551 stars 50 forks source link

Icon index as class constants #40

Closed srsbiz closed 11 months ago

srsbiz commented 11 months ago

Provides index of all available icons as class constans, so it can be used by IDE as hints in php code, i.e. in Filament panels

image

driesvints commented 11 months ago

While I do think this is cool I'm not sure I want to take this on in the library itself. These constants would be re-generated on each icon update and while a renamed icon isn't a breaking change, a renamed constant is. So I'm going to pass on this. But want to thank you for your proposal 👍

srsbiz commented 11 months ago

I understand your concern, I'm new to Laravel and blade templates, and I don't know how often things get renamed and how (like are there aliases to old name and deprecation notices?) In my understanding, if icon get renamed and old name is not available, things breaks anyway. On my first try I got a typo in icon name and got error page instead of working panel with one missing icon image Hence the idea of an index, missing constant is easily detected by IDE or static analyzers, while typo in some string is harder to spot on.