Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/irfaardy/esh-dompet
🚀 Lightweight E-Wallet for Laravel.
https://github.com/irfaardy/esh-dompet
composer esh-dompet php pin
Last synced: 26 days ago
JSON representation
🚀 Lightweight E-Wallet for Laravel.
- Host: GitHub
- URL: https://github.com/irfaardy/esh-dompet
- Owner: irfaardy
- License: mit
- Created: 2020-09-02T01:47:51.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-03T00:45:45.000Z (almost 4 years ago)
- Last Synced: 2024-04-15T00:26:14.229Z (7 months ago)
- Topics: composer, esh-dompet, php, pin
- Language: PHP
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# 🔒 **ESH Dompet**
Package ini berfungsi untuk menyimpan saldo ke dompet digital
🛠️ Installation with Composer
```php
composer require irfa/dompet
```>You can get Composer here
***
🛠️ Laravel Setup
1. Add to config/app.php
```php
'providers' => [
....
Irfa\Dompet\DompetServiceProvider::class,
];
```2. Add to config/app.php
```php
'aliases' => [
....
'Dompet' => Irfa\Dompet\Saku\Dompet::class,
],
```
3. Publish Vendor
php artisan vendor:publish --tag=dompet
4.Migrate Tables
```
php artisan migrate
```Basic Usage
Create new PIN
```php
use Dompet;
...
Dompet::make($user->id, 123456);
//return boolean
```Update PIN
```php
...
Dompet::credential($userID,$pin)->update($new_pin);
//return boolean
```Add Balance to account
```php
...
Dompet::credential($userID,$pin)->balance(20000)->add("Some Transaction",$transaction_id);
//return boolean
```Reduce Balance to account
```php
...
Dompet::credential($userID,$pin)->balance(20000)->reduce("Some Transaction",$transaction_id);
//return boolean
```Get total Balance
```php
...
Dompet::credential($user->id)->sumBalance();
//result 5000
//Formated number
Dompet::credential($user->id)->sumBalance(true);
// result 5,000
```Get Transaction History
```php
...
foreach(Dompet::credential($userID)->history() as $d)
{
echo $d->annotation." | ".$d->balance."
";
}
```Get Message success or fail
```php
if(Dompet::credential()->balance(2000)->add("Some Transaction",$transaction_id))
{
echo "Succeded, ".Dompet::message();
} else
{
echo "Failed, ".Dompet::message();
}```
------
## How to Contributing
1. Fork it ()
3. Commit your changes (`git commit -m 'Add some Feature'`)
4. Push to the branch (`git push origin version`)
5. Create a new Pull Request
***