zicht/classes
zicht/classes is a Laravel/PHP package that provides a clean, reusable foundation for class-based definitions and helpers, helping developers organize PHP classes more consistently and integrate them smoothly with Laravel conventions for maintainable application code.
<div class="{{ $isActive ? 'active' : '' }}">), a helper, or a dedicated package. This is a small, well-scoped answer to a recurring annoyance in server-rendered UIs.variant, size, disabled, loading), a class-joining utility shapes how ergonomic those component APIs feel. This influences whether designers/devs actually use the component library or hand-roll markup.Adopt only if all of the following hold:
@class([...]) directive (available since Laravel 8), or you are on a framework/PHP version where it is unavailable and you don't want to write the helper yourself.Look elsewhere (or build in-house) when:
@class directive; it covers the same ground with zero dependencies.px-2 and px-4 predictably). This package joins classes; it does not resolve conflicts. Use a tailwind-merge port instead.For executives (30 seconds): This package is a tiny PHP utility that conditionally joins CSS class names — the server-side equivalent of the JavaScript classnames library. It solves a real but minor developer-ergonomics problem in our templates. It carries no strategic value, has effectively no community adoption, and the same behavior is available either natively in current Laravel or via a short internal helper. Recommendation: do not adopt; close the evaluation and track a one-line in-house helper instead. Cost of adoption is near zero, but so is the upside — this is a "no decision" that should take minutes, not a sprint.
For engineering (the actual ask): We hit this pattern constantly in Blade — ternaries stacked into class attributes are noisy and error-prone. Two viable paths: (1) use Laravel's @class([...]) directive natively, which handles the common case; (2) add a ~20-line classNames() helper to our support package so it's available in plain PHP, not just Blade, and so we control the semantics. I'd rather own 20 lines than take on a dependency with zero dependents and an opaque maintenance story. If we later need Tailwind conflict merging, that's a separate, better-justified dependency.
Risk framing: Low technical risk either way; the real risk is dependency sprawl — accumulating small unmaintained packages that each need security review and upgrade attention during framework bumps. Declining this one keeps our composer.json honest.
How can I help you explore Laravel packages today?