PHPackages                             tautvydasr/blade-class-names - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. tautvydasr/blade-class-names

ActiveLibrary[Templating &amp; Views](/categories/templating)

tautvydasr/blade-class-names
============================

Package for handling html classes output based on conditions

3.0.0(3w ago)04.6k2MITPHPPHP ^8.2CI passing

Since Jun 13Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/tautvydasr/blade-class-names)[ Packagist](https://packagist.org/packages/tautvydasr/blade-class-names)[ RSS](/packages/tautvydasr-blade-class-names/feed)WikiDiscussions master Synced yesterday

READMEChangelog (5)Dependencies (4)Versions (10)Used By (0)

Blade class names
=================

[](#blade-class-names)

[![Build Status](https://github.com/tautvydasr/blade-class-names/workflows/tests/badge.svg?branch=master)](https://github.com/tautvydasr/blade-class-names/actions)

Simple package which helps to handle conditional html classes in blade templates.

**NOTICE:** If Laravel 8 or later is used consider using native [`@class` directive](https://laravel.com/docs/blade#conditional-classes) instead.

Installation
------------

[](#installation)

First of all require this package in composer:

```
composer require tautvydasr/blade-class-names
```

Finally, add service provider to `providers` array in your `config/app.php` file for Laravel:

```
'providers' => [
    // ...
    ClassNames\ClassNamesServiceProvider::class,
    // ...
],
```

or register service provider in `bootstrap/app.php` if using Lumen:

```
...
$app->register(\ClassNames\ClassNamesServiceProvider::class);
...
```

Usage
-----

[](#usage)

Basically package allows you to simplify conditional classes situations like this

```

    ...

```

to this using blade directive `@classNames()`.

```

    ...

```

For Lumen users it can be accessed via `app()` helper or facade.

```

    ...

    ...

```

Using facade approach make sure the line `$app->withFacades();` is uncommented in `bootstrap/app.php` file.

Local setup
-----------

[](#local-setup)

Copy example docker compose config file (optional):

```
cp docker-compose.yml.dist docker-compose.yml
```

Run docker containers (optional):

```
docker-compose up -d
```

Login to docker container where `CONTAINER_ID` is your id (optional):

```
docker exec -ti CONTAINER_ID /bin/bash
```

Install dependencies using composer:

```
composer install
```

Tests
-----

[](#tests)

Run phpunit tests:

```
./vendor/bin/phpunit
```

License
-------

[](#license)

Package is free to use and is licensed under the [MIT license](http://www.opensource.org/licenses/mit-license.php)

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance87

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 71.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~409 days

Recently: every ~531 days

Total

8

Last Release

24d ago

Major Versions

1.3.1 → 2.0.02026-02-03

2.0.0 → 3.0.02026-04-19

PHP version history (3 changes)1.0.0PHP ^7.1.3

1.3.1PHP ^7.1.3|^8.0

2.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/a5ec728b75aa376b75261463b01a33c700563ad89591c7e0ab2602af8b7d066e?d=identicon)[tautvydasr](/maintainers/tautvydasr)

---

Top Contributors

[![tautvydasr](https://avatars.githubusercontent.com/u/15105206?v=4)](https://github.com/tautvydasr "tautvydasr (30 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (8 commits)")[![thtg88](https://avatars.githubusercontent.com/u/16927402?v=4)](https://github.com/thtg88 "thtg88 (3 commits)")[![craigcoles](https://avatars.githubusercontent.com/u/996430?v=4)](https://github.com/craigcoles "craigcoles (1 commits)")

---

Tags

laravelbladeclass-names

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tautvydasr-blade-class-names/health.svg)

```
[![Health](https://phpackages.com/badges/tautvydasr-blade-class-names/health.svg)](https://phpackages.com/packages/tautvydasr-blade-class-names)
```

###  Alternatives

[robsontenorio/mary

Gorgeous UI components for Livewire powered by daisyUI and Tailwind

1.5k454.7k15](/packages/robsontenorio-mary)[stijnvanouplines/blade-country-flags

A package to easily make use of country flags in your Laravel Blade views.

26307.2k6](/packages/stijnvanouplines-blade-country-flags)[technikermathe/blade-lucide-icons

A package to easily make use of Lucide icons in your Laravel Blade views.

18299.2k7](/packages/technikermathe-blade-lucide-icons)[saade/blade-iconsax

A package to easily make use of Iconsax in your Laravel Blade views.

21138.5k](/packages/saade-blade-iconsax)[mckenziearts/blade-untitledui-icons

A package to easily make use of UntitledUI icons in your Laravel Blade views.

16104.9k5](/packages/mckenziearts-blade-untitledui-icons)[afatmustafa/blade-hugeicons

A package to easily make use of Hugeicons(Free version) in your Laravel Blade views.

13129.0k3](/packages/afatmustafa-blade-hugeicons)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
