1. Go to this page and download the library: Download graigdev/payment 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/ */
graigdev / payment example snippets
// Get a user's wallet
$wallet = \GraigDev\Payment\Models\Wallet::where('user_id', auth()->id())->first();
// If you published the models, use this instead:
// $wallet = \App\Models\Payment\Wallet::where('user_id', auth()->id())->first();
// Deposit funds
$wallet->deposit(100, 'Manual deposit');
// Withdraw funds
$wallet->withdraw(50, 'Manual withdrawal');
// Get all transactions for a wallet
$transactions = $wallet->transactions;
// Get transactions of a specific type
$deposits = $wallet->transactions()->ofType('DEPOSIT')->get();