����JFIF��x�x����'
Server IP : 66.29.137.217 / Your IP : 216.73.216.96 Web Server : LiteSpeed System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : gltevjme ( 1095) PHP Version : 7.0.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/gltevjme/./cbt.gltechlimited.com/vendor/bavix/laravel-wallet/docs/ |
Upload File : |
# Transfer Transfer in our system are two well-known [Deposit](deposit) and [Withdraw](withdraw) operations that are performed in one transaction. The transfer takes place between wallets. --- ## User Model [User Simple](_include/models/user_simple.md ':include') ## Make a Transfer Find user: ```php $first = User::first(); $last = User::orderBy('id', 'desc')->first(); // last user $first->getKey() !== $last->getKey(); // true ``` As the user uses `HasWallet`, he will have `balance` property. Check the user's balance. ```php $first->balance; // int(100) $last->balance; // int(0) ``` The transfer will be from the first user to the second. ```php $first->transfer($last, 5); $first->balance; // int(95) $last->balance; // int(5) ``` It worked! ## Force Transfer Check the user's balance. ```php $first->balance; // int(100) $last->balance; // int(0) ``` The transfer will be from the first user to the second. ```php $first->forceTransfer($last, 500); $first->balance; // int(-400) $last->balance; // int(500) ``` It worked!