PHP code example of joydeep-bhowmik / laravel-point-vault

1. Go to this page and download the library: Download joydeep-bhowmik/laravel-point-vault library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

joydeep-bhowmik / laravel-point-vault example snippets


'providers' => [
    JoydeepBhowmik\LaravelPointVault\Providers\LaravelPointVaultServiceProvider::class,
],

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use JoydeepBhowmik\LaravelPointVault\Traits\HasPoints;

class User extends Model
{
    use HasPoints;
}

$balance = $user->getCurrentBalance();
echo $balance; // Outputs the user's current point balance

$user->credit(100, 'Initial bonus');

$user->debit(50, 'Purchase item');

$transactions = $user->points;
bash
php artisan migrate
bash
php artisan vendor:publish --provider="JoydeepBhowmik\LaravelPointVault\Providers\LaravelPointVaultServiceProvider" --tag="migrations"