Package ini berfungsi untuk menyimpan saldo ke dompet digital
composer require irfa/dompet
You can get Composer here
'providers' => [
....
Irfa\Dompet\DompetServiceProvider::class,
];
'aliases' => [
....
'Dompet' => Irfa\Dompet\Saku\Dompet::class,
],
php artisan vendor:publish --tag=dompet
php artisan migrate
use Dompet;
...
Dompet::make($user->id, 123456);
//return boolean
...
Dompet::credential($userID,$pin)->update($new_pin);
//return boolean
...
Dompet::credential($userID,$pin)->balance(20000)->add("Some Transaction",$transaction_id);
//return boolean
...
Dompet::credential($userID,$pin)->balance(20000)->reduce("Some Transaction",$transaction_id);
//return boolean
...
Dompet::credential($user->id)->sumBalance();
//result 5000
//Formated number
Dompet::credential($user->id)->sumBalance(true);
// result 5,000
...
foreach(Dompet::credential($userID)->history() as $d)
{
echo $d->annotation." | ".$d->balance."<br>";
}
if(Dompet::credential()->balance(2000)->add("Some Transaction",$transaction_id))
{
echo "Succeded, ".Dompet::message();
} else
{
echo "Failed, ".Dompet::message();
}
- Fork it (https://github.com/irfaardy/esh-dompet/fork)
- Commit your changes (
git commit -m 'Add some Feature'
) - Push to the branch (
git push origin version
) - Create a new Pull Request