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

ActiveLibrary

skyraptor/laravel-achievements
==============================

Achievement-System for Laravel

0.1.8(5y ago)12.6kMITPHP

Since Apr 29Pushed 5y ago1 watchersCompare

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

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

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

[![Build Status](https://camo.githubusercontent.com/a6618fb8a6637ae231ac6588613b0300c1c4b4f47a27985a4d6ad41568cd68f9/68747470733a2f2f7472617669732d63692e6f72672f62756d62756d6d656e39392f6c61726176656c2d616368696576656d656e74732e737667)](https://travis-ci.org/bumbummen99/laravel-achievements)[![Code Style](https://camo.githubusercontent.com/99964140ef3ed8ddd8f0b30eea35d6eda76d9ce20edb6f2266c88b4dba62f697/68747470733a2f2f7374796c6563692e696f2f7265706f732f3235393934363638392f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/259946689)[![Total Downloads](https://camo.githubusercontent.com/4bea69458382d5835180f3aeca0d5d718252ea53ea2e35b60ccf3eda2c1a0780/68747470733a2f2f706f7365722e707567782e6f72672f736b79726170746f722f6c61726176656c2d616368696576656d656e74732f642f746f74616c2e737667)](https://packagist.org/packages/skyraptor/laravel-achievements)[![Latest Stable Version](https://camo.githubusercontent.com/a1f1c84d8af8838c1fa6e45cdc8352176d17bbd56545bd18402809658327e9a8/68747470733a2f2f706f7365722e707567782e6f72672f736b79726170746f722f6c61726176656c2d616368696576656d656e74732f762f737461626c65)](https://packagist.org/packages/skyraptor/laravel-achievements)[![Latest Unstable Version](https://camo.githubusercontent.com/8725a6ffc66c0884a10fec4239c5daa65b948c27894fd37a293401e47bc09088/68747470733a2f2f706f7365722e707567782e6f72672f736b79726170746f722f6c61726176656c2d616368696576656d656e74732f762f756e737461626c65)](https://packagist.org/packages/skyraptor/laravel-achievements)[![License](https://camo.githubusercontent.com/887e2809d15d33a044c7be659e2ffb722b82f054da7fe1fd490dac4d80893e8d/68747470733a2f2f706f7365722e707567782e6f72672f736b79726170746f722f6c61726176656c2d616368696576656d656e74732f6c6963656e73652e737667)](https://packagist.org/packages/skyraptor/laravel-achievements)

An implementation of an Achievement System in Laravel, inspired by Laravel's Notification system. This is a fork and continuation of [Gabriel Simonetti's](https://github.com/gabriel-simonetti) [Laravel Achievements](https://github.com/gstt/laravel-achievements) package.

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)

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

[](#-requirements)

- Laravel 6 or higher
- PHP 7.2 or higher

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

[](#-installation)

Default installation is via [Composer](https://getcomposer.org/). The service provider will automatically get registered.

```
composer require skyraptor/laravel-achievements
```

You can publish the configuration of this package with the following command.

```
php artisan vendor:publish --provider="SkyRaptor\Achievements\AchievementsServiceProvider" --tag="config"
```

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:

```
