PHPackages                             romjkeeee/laravel-achievements - 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. romjkeeee/laravel-achievements

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

romjkeeee/laravel-achievements
==============================

Achievements for Laravel 6+

2.3.4(5y ago)021MITPHP

Since Mar 3Pushed 5y agoCompare

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

READMEChangelog (1)Dependencies (3)Versions (12)Used By (0)

 [![Laravel Achievements Logo](https://camo.githubusercontent.com/5e3ea650c79584ceb9122b7cca8356d5604891d153e2c8760128d8fff7796956/68747470733a2f2f692e696d6775722e636f6d2f565a33754c6c4a2e706e67)](https://camo.githubusercontent.com/5e3ea650c79584ceb9122b7cca8356d5604891d153e2c8760128d8fff7796956/68747470733a2f2f692e696d6775722e636f6d2f565a33754c6c4a2e706e67)

[![Build Status](https://camo.githubusercontent.com/ee66a3cc2b6f35e0b9dc6f8de1b0682f1623c99645351c0741be4cc89a6b2382/68747470733a2f2f7472617669732d63692e6f72672f6173736164612f6c61726176656c2d616368696576656d656e74732e737667)](https://travis-ci.org/assada/laravel-achievements)[![Total Downloads](https://camo.githubusercontent.com/5e7adc2739d4e521cf26265d39113703943e183b47981e379adfcf36ec5509a4/68747470733a2f2f706f7365722e707567782e6f72672f6173736164612f6c61726176656c2d616368696576656d656e74732f642f746f74616c2e737667)](https://packagist.org/packages/assada/laravel-achievements)[![License](https://camo.githubusercontent.com/d458ff3f947824f927e81f041b94ef8ea674c261b45cc4c182e84a983bcdc52f/68747470733a2f2f706f7365722e707567782e6f72672f6173736164612f6c61726176656c2d616368696576656d656e74732f6c6963656e73652e737667)](https://packagist.org/packages/assada/laravel-achievements)

An implementation of an Achievement System in Laravel, inspired by Laravel's Notification system.

Table of Contents
-----------------

[](#table-of-contents)

1. [Requirements](#requirements)
2. [Installation](#installation)
3. [Creating Achievements](#creating)
4. [Unlocking Achievements](#unlocking)
5. [Adding Progress](#progress)
6. [Retrieving Achievements](#retrieving)
7. [Event Listeners](#listening)
8. [License](#license)

 Requirements
-----------------------------------------------------

[](#-requirements)

- Laravel 6 or higher
- PHP 7.2 or higher

Versions and branches
---------------------

[](#versions-and-branches)

- v1.\* - Original `Gstt\*` namespace with supporting Laravel 6 and PHP7.2 (only fix and security updates)
- v2.\* (master) - New namespace `Assada\*` with supporting Laravel &gt;=6 and PHP7.2 (fixes, security and feature updates)

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

[](#-installation)

Default installation is via [Composer](https://getcomposer.org/).

```
composer require assada/laravel-achievements
```

The service provider will automatically get registered. Or you could add the Service Provider manually to your `config/app` file in the `providers` section.

```
'providers' => [
    //...
    Assada\Achievements\AchievementsServiceProvider::class,
]
```

Backup your database and run the migrations in order to setup the required tables on the database.

```
php artisan migrate
```

 Creating Achievements
----------------------------------------------------------

[](#-creating-achievements)

Similar to Laravel's implementation of [Notifications](https://laravel.com/docs/5.4/notifications), each Achievement is represented by a single class (typically stored in the `app\Achievements` directory.) This directory will be created automatically for you when you run the `make:achievement` command.

```
php artisan make:achievement UserMadeAPost
```

This command will put a fresh Achievement in your `app/Achievements` directory with only has two properties defined: `name` and `description`. You should change the default values for these properties to something that better explains what the Achievement is and how to unlock it. When you're done, it should look like this:

```
