zicht/twig-classes
A Twig extension for building CSS class lists in templates. Add classes conditionally, merge class arrays, and output clean class attributes without messy inline logic, keeping Twig markup readable and maintainable in Laravel/PHP projects.
zicht/twig-classes adds a convenient classes helper to Twig, letting you build conditional CSS class strings directly in your templates. Inspired by Laravel's @class directive, it keeps markup clean by replacing clumsy ternary chains and string concatenation with a readable array syntax—so only the classes that evaluate to true are rendered.
false valuesHow can I help you explore Laravel packages today?