faustbrian/laravel-rewardable

Credits, Badges and Ranks for Eloquent Models for Laravel 5

2.3.0 2018-11-10 06:32 UTC

README

Build Status PHP from Packagist Latest Version License

Installation

Require this package, with Composer, in the root directory of your project.

$ composer require faustbrian/laravel-rewardable

To get started, you'll need to publish the vendor assets and migrate:

php artisan vendor:publish --provider="BrianFaust\Rewardable\RewardableServiceProvider" && php artisan migrate

Usage

Setup a Model

<?php


namespace App;

// use BrianFaust\Rewardable\Badges\HasBadges;
// use BrianFaust\Rewardable\Credits\HasCredits;
// use BrianFaust\Rewardable\Ranks\HasRanks;
// use BrianFaust\Rewardable\Transactions\HasTransactions;
use BrianFaust\Rewardable\HasRewardsTrait;
use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    use HasRewards;

    // these can be required one-by-one if you don't need all and don't use HasRewards
    // use HasBadges;
    // use HasCredits;
    // use HasRanks;
    // use HasTransactions;
}

Testing

$ phpunit

Security

If you discover a security vulnerability within this package, please send an e-mail to hello@brianfaust.me. All security vulnerabilities will be promptly addressed.

Credits

License

MIT © Brian Faust