cachethq/badger

A badge generator for Laravel.
46,730 20
Install
composer require cachethq/badger
Latest Version:v5.0.0
PHP:^8.2
License:MIT
Last Updated:Aug 12, 2026
Links: GitHub  ·  Packagist
Maintainer: graham-campbell

An SVG badge generator for Laravel.

Installation

This version requires PHP 8.2 and Laravel 12.0 and above. For older versions of PHP or Laravel, check out the 4.x branch.

To get the latest version, simply require the project using Composer:

composer require cachethq/badger

Once installed, if you are not using automatic package discovery, then you need to register the Cachet\Badger\BadgerServiceProvider service provider in your config/app.php.

Examples

Get started immediately:

// Using the Facade
Badger::generate('license', 'MIT', 'blue', 'plastic')

// Dependency injection example
$badger->generate('license', 'MIT', '#ff69b4', 'plastic')

Usage

The generate method takes four parameters:

Badger::generate('license', 'MIT', 'blue', 'flat-square')

The first parameter is the subject, or what it is the badge is showing. In the example above this is the license. The second parameter is the value (the right hand of the badge). Next is the color of the badge. This can be one of the following preset colors or a valid hex string.

  • brightgreen
  • green
  • yellow
  • yellowgreen
  • orange
  • red
  • blue
  • grey
  • lightgray

And finally the fourth parameter is the badge type. This determines the style of the badge and can be one of the five values below.

  • flat-square (default)
  • plastic-flat, flat
  • plastic
  • social (without links)
  • for-the-badge

Security

If you discover a security vulnerability within this package, please e-mail us at support@cachethq.io. All security vulnerabilities will be promptly addressed.

License

Cachet Badger is licensed under The MIT License (MIT).

Based on the work done at badges/poser.

Related Packages

cachethq/twitter

A Twitter handle parser for Laravel 5 and 6

41,717 2
cachethq/emoji

An Emoji Parser For Laravel 5 and 6

41,946 4
qcod/laravel-gamify

Add gamification in laravel app with reputation point and badges support

400,560 678
rinvex/countries

Rinvex Countries is a simple and lightweight package for retrieving country deta...

8,555,938 1,745