2017 © Pedro Peláez
 

library larawallet

image

nattaponra/larawallet

  • Monday, June 25, 2018
  • by nattaponra
  • Repository
  • 1 Watchers
  • 0 Stars
  • 33 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Lara Wallet

Lara wallet is a wallet system package that allow you fast develop wallet system in laravel framework., (*1)

Features

  • Balance checking
  • Deposition
  • Withdrawal
  • Transfer
  • fee
  • SanBox Mode

1. Installation

Install the package with composer:, (*2)

composer require nattaponra/larawallet

2. Run Migrations

Publish the migrations and config file with this artisan command:, (*3)

php artisan vendor:publish --provider="nattaponra\LaraWallet\LaraWalletServiceProvider"

Run migration file to create database tables:, (*4)

php artisan migrate

3. Wallet using with user model.

Add 'HasWallet' trait in User model (app/User.php): And Add 'HasSanBoxWallet' trait for sanbox mode., (*5)

class User extends Authenticatable
{

    use HasWallet;
    use HasSanBoxWallet;

    ......
}

4. Using

Create example user, (*6)

$user = Auth::user();

Balance checking, (*7)

echo $user->wallet->balance()

Deposition, (*8)

$user->wallet->deposit(100);

Withdrawal, (*9)

$user->wallet->withdraw(5000);

Transfer, (*10)


$user1 = User::find(1); $user2 = User::find(2); $user1->wallet->deposit(15000); $user1->wallet->transfer(1000,$user2); echo $user1->wallet->balance(); #14000 echo $user2->wallet->balance(); #1000

SanBox Mode, (*11)

  $user->sanBoxWallet->balance();

Option

The Versions

25/06 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Development Requires

by Nattapon Rakthong

20/06 2018

v1.2

1.2.0.0

  Sources   Download

MIT

The Development Requires

by Nattapon Rakthong

19/06 2018

v1.1

1.1.0.0

  Sources   Download

MIT

The Development Requires

by Nattapon Rakthong

17/06 2018

v1.0

1.0.0.0

  Sources   Download

The Development Requires

by Nattapon Rakthong