Laravel Rewardable
Install
Via Composer
$ composer require draperstudio/laravel-rewardable
And then include the service provider within app/config/app.php
.
'providers' => [
DraperStudio\Rewardable\ServiceProvider::class
];
At last you need to publish and run the migration.
php artisan vendor:publish --provider="DraperStudio\Rewardable\ServiceProvider" && php artisan migrate
Usage
Setup a Model
<?php
/*
* This file is part of Laravel Rewardable.
*
* (c) DraperStudio <hello@draperstudio.tech>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App;
// use DraperStudio\Rewardable\Traits\Badgeable as BadgeableTrait;
// use DraperStudio\Rewardable\Traits\Creditable as CreditableTrait;
// use DraperStudio\Rewardable\Traits\Rankable as RankableTrait;
// use DraperStudio\Rewardable\Traits\Transactionable as TransactionableTrait;
use DraperStudio\Rewardable\Traits\Rewardable as RewardableTrait;
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
use RewardableTrait;
// these can be required one-by-one if you don't need all and don't use RewardableTrait
// use BadgeableTrait;
// use CreditableTrait;
// use RankableTrait;
// use TransactionableTrait;
}
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email hello@draperstudio.tech instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.