1111use Illuminate \Database \Eloquent \Relations \MorphMany ;
1212use Illuminate \Support \Collection ;
1313use Illuminate \Support \Facades \DB ;
14- use Illuminate \ Support \ Str ;
14+ use Ramsey \ Uuid \ Uuid ;
1515
1616/**
1717 * Class HasWallet
@@ -141,6 +141,7 @@ public function forceTransfer(Wallet $wallet, int $amount, ?array $meta = null):
141141 * @param Transaction $withdraw
142142 * @param Transaction $deposit
143143 * @return Transfer
144+ * @throws
144145 */
145146 protected function assemble (Wallet $ wallet , Transaction $ withdraw , Transaction $ deposit ): Transfer
146147 {
@@ -154,7 +155,7 @@ protected function assemble(Wallet $wallet, Transaction $withdraw, Transaction $
154155 'from_id ' => $ this ->getKey (),
155156 'to_type ' => $ wallet ->getMorphClass (),
156157 'to_id ' => $ wallet ->getKey (),
157- 'uuid ' => Str:: uuid ()->toString (),
158+ 'uuid ' => Uuid:: uuid4 ()->toString (),
158159 ]);
159160 }
160161
@@ -163,6 +164,7 @@ protected function assemble(Wallet $wallet, Transaction $withdraw, Transaction $
163164 * @param array|null $meta
164165 * @param bool $confirmed
165166 * @return Transaction
167+ * @throws
166168 */
167169 protected function change (int $ amount , ?array $ meta , bool $ confirmed ): Transaction
168170 {
@@ -172,7 +174,7 @@ protected function change(int $amount, ?array $meta, bool $confirmed): Transacti
172174 'type ' => $ amount > 0 ? 'deposit ' : 'withdraw ' ,
173175 'payable_type ' => $ this ->getMorphClass (),
174176 'payable_id ' => $ this ->getKey (),
175- 'uuid ' => Str:: uuid ()->toString (),
177+ 'uuid ' => Uuid:: uuid4 ()->toString (),
176178 'confirmed ' => $ confirmed ,
177179 'amount ' => $ amount ,
178180 'meta ' => $ meta ,
0 commit comments