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

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

itvoland/laravel-achievements
=============================

Achievements for Laravel 6+

1.0.0(3y ago)0249MITPHP

Since Jul 29Pushed 3y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (2)Used By (0)

 [![Laravel Achievements Logo](https://camo.githubusercontent.com/601978949a216aa5ca912fa8a9e6dc8eaa399d614d48d6fd62dff69d323ec75b/68747470733a2f2f696d673030312e70726e747363722e636f6d2f66696c652f696d673030312f726156526b4849705235756d6d3042547955746b70672e706e67)](https://camo.githubusercontent.com/601978949a216aa5ca912fa8a9e6dc8eaa399d614d48d6fd62dff69d323ec75b/68747470733a2f2f696d673030312e70726e747363722e636f6d2f66696c652f696d673030312f726156526b4849705235756d6d3042547955746b70672e706e67)

[![Build Status](https://camo.githubusercontent.com/8831a1e6d3ea92097642e3cecbeb4f32b661dc856fbc56a4e37cf53017ecc456/68747470733a2f2f6170702e7472617669732d63692e636f6d2f6974766f6c616e642f6c61726176656c2d616368696576656d656e74732e737667)](https://app.travis-ci.com/itvoland/laravel-achievements)[![Total Downloads](https://camo.githubusercontent.com/64a443ca1ffbe5198ab2f0e8d9b73a8f20c44cf4ba5c0b7268efbf22c997573c/68747470733a2f2f706f7365722e707567782e6f72672f6974766f6c616e642f6c61726176656c2d616368696576656d656e74732f642f746f74616c2e737667)](https://packagist.org/packages/itvoland/laravel-achievements)[![License](https://camo.githubusercontent.com/c71536c7c3eb09324d7ffbc9bc573d630703ce4d86d258536082f8fe53f26264/68747470733a2f2f706f7365722e707567782e6f72672f6974766f6c616e642f6c61726176656c2d616368696576656d656e74732f6c6963656e73652e737667)](https://packagist.org/packages/itvoland/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)

- v2.\* (master) - New namespace `ITVOLAND\*` 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 itvoland/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' => [
    //...
    ITVOLAND\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:

```
