PHPackages                             tobya/tailwind-trumpet - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tobya/tailwind-trumpet

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tobya/tailwind-trumpet
======================

A Package to trumpet or expose Tailwind css classes that are set in code.

v0.6(3mo ago)02.5k↓100%[1 PRs](https://github.com/tobya/tailwind-trumpet/pulls)MITPHPCI failing

Since May 29Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/tobya/tailwind-trumpet)[ Packagist](https://packagist.org/packages/tobya/tailwind-trumpet)[ Docs](https://github.com/tobya/tailwind-trumpet)[ GitHub Sponsors](https://github.com/Tobya)[ RSS](/packages/tobya-tailwind-trumpet/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (11)Versions (9)Used By (0)

Tailwind Trumpet
================

[](#tailwind-trumpet)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9e3f6e5f1f89f53399731097884717c97d5c9d63524646765632741ec13408e2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f6279612f7461696c77696e642d7472756d7065742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tobya/tailwind-trumpet)[![GitHub Tests Action Status](https://camo.githubusercontent.com/fb9cbd3dd6b342bd54bbf39bd45d6aeebc1b075e72cd10c7558e1cb0cbb14b7f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f746f6279612f7461696c77696e642d7472756d7065742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/tobya/tailwind-trumpet/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/692ff10559ed2b889ae73cbbdde712a83575b73145e55af635e342fb8c161984/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f746f6279612f7461696c77696e642d7472756d7065742f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/tobya/tailwind-trumpet/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/d741ea150e54c1ee558859e28b77c79a2d16beedaa680ec8aa9b3f08269f71c5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f6279612f7461696c77696e642d7472756d7065742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tobya/tailwind-trumpet)

Tailwind Trumpet, Trumpets(!) your hidden tailwind classes. Expose those hidden css classes used in your php objects so they will always be available in your blades

Sometimes you might find that you have a set of colors or other styles that you assign in your php code eg you have a list of courses of specific type and you want each type to be the same tailwind color when displayed on your front end, but because tailwind compiles away unused classes and does not scan php code, you need to move this code to the front end usually.

Tailwind Trumpet solves this problem by allowing you to register any tailwind classes you php code uses and then these are published to your `views` directory so that tailwinds build process will find them.

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

[](#installation)

You can install the package via composer:

```
composer require tobya/tailwind-trumpet
```

You can publish the config file with:

```
php artisan vendor:publish --tag="tailwind-trumpet-config"
```

This will output the following file.

`config/trumpet.php`

```
| A list of  classes here that will return a list of classes that need to be exposed.
| classes must have a function trumpetTailwindClasses() that returns a String or array of Strings

```

```
return [
        \App\Services\CourseTypeLookupService::class,
];
```

Usage
-----

[](#usage)

#### Implementation

[](#implementation)

For any class that you list in the class list in `config/trumpet.php` ensure that it implements a method called `trumpetTailwindClasses()`. This method takes no parameters and returns an array of strings. These strings are the tailwind classes you wish to include.

```
    public function trumpetTailwindClasses(){
        return [
                 'bg-red-700 text-white',
                 'bg-green-700 text-white',
               ];
    }
```

Then run the artisan command to generate the blade file with tailwind classes included. You can add this to your git repo.

```
 > php artisan trumpet:expose
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Toby Allen](https://github.com/tobya)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance86

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 58.3% 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 ~124 days

Recently: every ~155 days

Total

6

Last Release

93d ago

PHP version history (2 changes)v0.1PHP ^7.4|^8.0

v0.2PHP ^8.0

### Community

Maintainers

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

---

Top Contributors

[![tobya](https://avatars.githubusercontent.com/u/325502?v=4)](https://github.com/tobya "tobya (21 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (9 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (6 commits)")

---

Tags

laravelTobyatailwind-trumpet

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/tobya-tailwind-trumpet/health.svg)

```
[![Health](https://phpackages.com/badges/tobya-tailwind-trumpet/health.svg)](https://phpackages.com/packages/tobya-tailwind-trumpet)
```

###  Alternatives

[highideas/laravel-users-online

This package will provide an online users management.

203113.2k1](/packages/highideas-laravel-users-online)[stephenjude/filament-blog

Filament Blog Builder

20317.8k](/packages/stephenjude-filament-blog)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[datomatic/nova-detached-actions

A Laravel Nova tool to allow for placing actions in the Nova toolbar detached from the checkbox selection mechanism.

11229.2k](/packages/datomatic-nova-detached-actions)

PHPackages © 2026

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