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

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

mmertz/laravel-achievements
===========================

Achievements for Laravel 5.3+

014PHP

Since Feb 6Pushed 7y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Achievements
====================

[](#laravel-achievements)

[![Build Status](https://camo.githubusercontent.com/2da4a7f64130d9d71639e23491f7ac4e0f58a766399a0a09e754cf993bf7a49b/68747470733a2f2f7472617669732d63692e6f72672f4d697463682f6c61726176656c2d616368696576656d656e74732e737667)](https://travis-ci.org/Mitch/laravel-achievements)[![Total Downloads](https://camo.githubusercontent.com/1141fb3ff8666e8480ea7a432334d8e4eb74a300d912b9c54dfe6532207c47f2/68747470733a2f2f706f7365722e707567782e6f72672f4d697463682f6c61726176656c2d616368696576656d656e74732f642f746f74616c2e737667)](https://packagist.org/packages/Mitch/laravel-achievements)[![License](https://camo.githubusercontent.com/1cc8e2cecfc690ca47f772a8900e12954a120709c7d03544ce62347b65642877/68747470733a2f2f706f7365722e707567782e6f72672f4d697463682f6c61726176656c2d616368696576656d656e74732f6c6963656e73652e737667)](https://packagist.org/packages/Mitch/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 5.3 or higher
- PHP 5.6 or higher

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

[](#-installation)

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

```
composer require mitch/laravel-achievements

```

Add the Service Provider to your `config/app` file in the `providers` section.

```
'providers' => [
    ...
    Mmertz\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:

```
