Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Classes Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • View-layer templating decisions: whether conditional class rendering lives in Blade templates (<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.
  • Build vs. buy (and here, likely build): the core decision this triggers is not "which package" but "do we add a Composer dependency for something a 15–30 line helper can do?" That is a real supply-chain and maintenance trade-off worth a ticket, not a design doc.
  • Design system / component API decisions: when defining Blade components with variant props (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.
  • Roadmap hygiene: with zero dependents, an unknown star count, and a computed score of 0, this is a candidate for "evaluate, don't adopt" — the decision output is a documented no-go plus a one-line in-house helper on the roadmap.
  • Use cases where the pattern matters: conditional state styling (active tabs, selected filters, validation error states), RTL/dark-mode class toggles, and server-rendered forms where you need deterministic class output for CSS specificity or snapshot tests.

When to Consider This Package

Adopt only if all of the following hold:

  • You are on a PHP/Laravel (or similar) stack and have a meaningful volume of conditional class logic — dozens of Blade components, not two or three templates.
  • You have no access to Laravel's built-in @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.
  • You have validated the package's API surface and license against your dependency policy, and you are comfortable with an unmaintained/low-traffic dependency (zero dependents is a strong signal of low community vetting).
  • Your team has a dependency budget and a policy that prefers pinned, auditable packages over bespoke helpers — some orgs do, particularly in regulated environments where "vendor code with a changelog" beats "internal helper nobody owns."

Look elsewhere (or build in-house) when:

  • You are on Laravel 8+ — use the native @class directive; it covers the same ground with zero dependencies.
  • You need Tailwind conflict resolution (e.g., merging px-2 and px-4 predictably). This package joins classes; it does not resolve conflicts. Use a tailwind-merge port instead.
  • You need performance-sensitive rendering at scale — a helper you control is trivially optimizable and introspectable.
  • Supply-chain or audit requirements are strict: a zero-star, zero-dependent package is exactly the profile that fails procurement review, and the cost of justifying it exceeds the cost of writing the helper.

How to Pitch It (Stakeholders)

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin