PHPackages                             maize-tech/laravel-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. maize-tech/laravel-badges

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

maize-tech/laravel-badges
=========================

Laravel Badges

1.2.0(10mo ago)376.6k7[4 PRs](https://github.com/maize-tech/laravel-badges/pulls)MITPHPPHP ^8.2CI passing

Since Oct 4Pushed 2mo ago4 watchersCompare

[ Source](https://github.com/maize-tech/laravel-badges)[ Packagist](https://packagist.org/packages/maize-tech/laravel-badges)[ Docs](https://github.com/maize-tech/laravel-badges)[ RSS](/packages/maize-tech-laravel-badges/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (10)Versions (7)Used By (0)

   ![Social Card of Laravel Badges](/art/socialcard-light.png)

Laravel Badges
==============

[](#laravel-badges)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9b5bd0443c49ddc55fced94ddb1b75d7af1f148341be336298a8025ea04d0d46/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61697a652d746563682f6c61726176656c2d6261646765732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/maize-tech/laravel-badges)[![GitHub Tests Action Status](https://camo.githubusercontent.com/ff508a54d8008f72fef15f23575a085d334cadf131d072264cc42fedcd5e24c9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d61697a652d746563682f6c61726176656c2d6261646765732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/maize-tech/laravel-badges/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/ad0116a3d3a13c8d6d083b9daa5fd5881e7d6332d90c929a785cfdd25414a690/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d61697a652d746563682f6c61726176656c2d6261646765732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/maize-tech/laravel-badges/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/f15d4b20d7c634a7ce1a3757178dffe0901a72ccdb57f86ce92d4fe3f233165c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d61697a652d746563682f6c61726176656c2d6261646765732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/maize-tech/laravel-badges)

This package lets you easily add badge mechanics to your application.

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

[](#installation)

You can install the package via composer:

```
composer require maize-tech/laravel-badges
```

You can publish the config and migration files and run the migrations with:

```
php artisan badges:install
```

This is the contents of the published config file:

```
return [

    /*
    |--------------------------------------------------------------------------
    | Badge model
    |--------------------------------------------------------------------------
    |
    | Here you may specify the fully qualified class name of the badge model.
    |
    */

    'model' => Maize\Badges\Models\BadgeModel::class,

    /*
    |--------------------------------------------------------------------------
    | Badges
    |--------------------------------------------------------------------------
    |
    | Here you may specify the list of fully qualified class name of badges.
    |
    */

    'badges' => [
        // App\Badges\FirstLogin::class,
    ],

];
```

Usage
-----

[](#usage)

### Basic

[](#basic)

To use the package, firstly you should implement the `Maize\Badges\HasBadges` interface and apply the `Maize\Badges\InteractsWithBadges` trait to all models who can have badges:

```
