PHPackages                             midnite81/badges - 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. midnite81/badges

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

midnite81/badges
================

Render out package badges

v1.0.4(7y ago)02663MITPHP

Since Jul 14Pushed 4y ago1 watchersCompare

[ Source](https://github.com/midnite81/badges)[ Packagist](https://packagist.org/packages/midnite81/badges)[ RSS](/packages/midnite81-badges/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (4)Dependencies (4)Versions (6)Used By (0)

Badges
======

[](#badges)

[![Latest Stable Version](https://camo.githubusercontent.com/38b04e1141aabecf4cb7b042ee59c6c620ed3182df60c5d20f4162da44d72fd4/68747470733a2f2f706f7365722e707567782e6f72672f6d69646e69746538312f6261646765732f76657273696f6e)](https://packagist.org/packages/midnite81/badges) [![Total Downloads](https://camo.githubusercontent.com/39a0a0688cdbfb2fed387be7944663655b00982eeb44d6454b5a13f9585615f0/68747470733a2f2f706f7365722e707567782e6f72672f6d69646e69746538312f6261646765732f646f776e6c6f616473)](https://packagist.org/packages/midnite81/badges) [![Latest Unstable Version](https://camo.githubusercontent.com/3b3c334944c752664b92c1c65bbd07601ecd6ac97e24f113e9afba71320d0a46/68747470733a2f2f706f7365722e707567782e6f72672f6d69646e69746538312f6261646765732f762f756e737461626c65)](https://packagist.org/packages/midnite81/badges) [![License](https://camo.githubusercontent.com/87096f6d5dcf6a01e0512e7302a7cfb0f7061a2ab54c76c8561a8b841feaa635/68747470733a2f2f706f7365722e707567782e6f72672f6d69646e69746538312f6261646765732f6c6963656e73652e737667)](https://packagist.org/packages/midnite81/badges) [![Build](https://camo.githubusercontent.com/9cc822e3e3e6b26c66215d505b061704b405eba98748d980c64f0be5e8f349f9/68747470733a2f2f7472617669732d63692e6f72672f6d69646e69746538312f6261646765732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/midnite81/badges) [![Coverage Status](https://camo.githubusercontent.com/4cbeceead7ab796e66af38f808484cbff7cd8cfdb7f11c494da7481c6fab3d80/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d69646e69746538312f6261646765732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/midnite81/badges?branch=master)
*A PHP package to render out package badges*

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

[](#installation)

This package requires PHP 5.6+

To install through composer include the package in your `composer.json`.

```
"midnite81/badges": "^1.0.0"

```

Run `composer install` or `composer update` to download the dependencies or you can run `composer require midnite81/badges`.

Badges Supported
----------------

[](#badges-supported)

TypeExampleLatest Stable[![Latest Stable Version](https://camo.githubusercontent.com/38b04e1141aabecf4cb7b042ee59c6c620ed3182df60c5d20f4162da44d72fd4/68747470733a2f2f706f7365722e707567782e6f72672f6d69646e69746538312f6261646765732f76657273696f6e)](https://packagist.org/packages/midnite81/badges)Total Downloads[![Total Downloads](https://camo.githubusercontent.com/39a0a0688cdbfb2fed387be7944663655b00982eeb44d6454b5a13f9585615f0/68747470733a2f2f706f7365722e707567782e6f72672f6d69646e69746538312f6261646765732f646f776e6c6f616473)](https://packagist.org/packages/midnite81/badges)Latest Unstable[![Latest Unstable Version](https://camo.githubusercontent.com/3b3c334944c752664b92c1c65bbd07601ecd6ac97e24f113e9afba71320d0a46/68747470733a2f2f706f7365722e707567782e6f72672f6d69646e69746538312f6261646765732f762f756e737461626c65)](https://packagist.org/packages/midnite81/badges)Licence[![License](https://camo.githubusercontent.com/87096f6d5dcf6a01e0512e7302a7cfb0f7061a2ab54c76c8561a8b841feaa635/68747470733a2f2f706f7365722e707567782e6f72672f6d69646e69746538312f6261646765732f6c6963656e73652e737667)](https://packagist.org/packages/midnite81/badges)Build[![Build](https://camo.githubusercontent.com/9cc822e3e3e6b26c66215d505b061704b405eba98748d980c64f0be5e8f349f9/68747470733a2f2f7472617669732d63692e6f72672f6d69646e69746538312f6261646765732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/midnite81/badges)Coverage[![Coverage Status](https://camo.githubusercontent.com/4cbeceead7ab796e66af38f808484cbff7cd8cfdb7f11c494da7481c6fab3d80/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d69646e69746538312f6261646765732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/midnite81/badges?branch=master)Gitter[![Join the chat at https://gitter.im/midnite81-badges](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/midnite81-badges/?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)StyleCI(Image Coming soon)Scrutinizer(Image Coming soon)Over time support for other badges will be added. You can create your own templates which extend `Midnite81\Badges\Type\BadgeType` and can be passed through the `$badges->get(MyClass::class)` method. More documentation on adding your own templates will be added later.

Example Usage
-------------

[](#example-usage)

Firstly, you need to create an instance of badges.

```
use Midnite81\Badges\Badges;
$badges = new Badges($attributes);
// or
$badges = Badges::create($attributes);
```

You'll notice that a variable of $attributes is passed on construction. The attributes are what the package will use to translate the template. By default we're only going to pass the following attributes as they are needed for the supported badges. Obviously update the above attributes to suit your own needs.

```
$attributes = [
    '$PACKAGE_NAME$' => 'midnite81/badges', // Your GitHub package repo name
    '$STYLE_CI$' => 'repoNumber', // Your StyleCi repo number
    '$GITTER_ROOM$' => 'room-name' // Your gitter room name
];

```

Once the class is instantiated, you then need to select the type of badge you want.

```
$myBadge = $this->latestStableVersion();
```

This will return you a `Writer` object, which you can call `->toHtml()` or `->toMarkdown` on for the final rendering of the badge. The default `_toString` method will return the html version.

So all in all;

```
use Midnite81\Badges\Badges;
$badges = Badges::create(['$PACKAGE_NAME$' => 'midnite81/badges']);

echo $badges->latestStableVersion()->toMarkdown();

```

will output

[![Latest Stable Version](https://camo.githubusercontent.com/38b04e1141aabecf4cb7b042ee59c6c620ed3182df60c5d20f4162da44d72fd4/68747470733a2f2f706f7365722e707567782e6f72672f6d69646e69746538312f6261646765732f76657273696f6e)](https://packagist.org/packages/midnite81/badges)

`[![Latest Stable Version](https://poser.pugx.org/midnite81/badges/version)](https://packagist.org/packages/midnite81/badges)`

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

5

Last Release

2905d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/254850?v=4)[Simon Rogers](/maintainers/midnite81)[@midnite81](https://github.com/midnite81)

---

Top Contributors

[![midnite81](https://avatars.githubusercontent.com/u/254850?v=4)](https://github.com/midnite81 "midnite81 (14 commits)")

---

Tags

badgespackage-badgespackagesphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/midnite81-badges/health.svg)

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

###  Alternatives

[yireo/magento2-googletagmanager2

Add Google Tag Manager to Magento

166986.9k5](/packages/yireo-magento2-googletagmanager2)[artisansdk/cqrs

A foundational package for Command Query Responsibility Segregation (CQRS) compatible with Laravel.

8415.4k](/packages/artisansdk-cqrs)[hacoidev/ophim-core

Ophim's core features

1028.1k24](/packages/hacoidev-ophim-core)

PHPackages © 2026

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