PHPackages                             aecy/badge - 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. aecy/badge

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

aecy/badge
==========

Add badge system to your laravel project

43.7k7PHP

Since Nov 2Pushed 7y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel - Badge System
======================

[](#laravel---badge-system)

This package helps you for create a badge, you can add a badge to an user and more...

[![](https://camo.githubusercontent.com/22a96ef508ff8eb6c3f6d6f2d27094ccf625f1233dcf5c3d986649ec596ed0e1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f616563792f6c61726176656c2d62616467652e737667)](https://github.com/aecy/laravel-badge/issues)[![](https://camo.githubusercontent.com/905ff4d347bf6d3593821cb0dd13f41a434f5b01aa9bf5d7d80aa485d60495d7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f616563792f6c61726176656c2d62616467652e737667)](https://github.com/aecy/laravel-badge/stargazers)[![](https://camo.githubusercontent.com/f7c840952b28bd725b6c0b499735440f77abb12f67346a68c11ee74f394f493e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f616563792f6c61726176656c2d62616467652e737667)](https://github.com/aecy/laravel-badge/network)

Features
--------

[](#features)

You can reward your users when they post comments on your application, you can add new badge for comments and create your badges, for example create the premium badge, ...

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

[](#installation)

### Required

[](#required)

- PHP 7.0 +
- Laravel 5.5 +
- Simple Comment system with column `user_id`

You can install the package using `composer` and run `vendor:publish`

```
$ composer require aecy/badge
```

```
$ php artisan vendor:publish --provider='Aecy\Badge\BadgeServiceProvider' --tag="migrations"
```

The badge for your `Comment` model is already create and good for using in your application, for using it on `Comment`you need to add this trait in your model.

```
use Badgeable;
```

> DON'T FORGET : IMPORT THE CLASS.

Create Badge
------------

[](#create-badge)

Create your own badge, in `App\Events\` create `Premium.php`if the folder `Events` doenst exist in `App` folder, create him.

In the `Premium.php` copy and paste :

```
