Skip to content

Commit

Permalink
Merge pull request #12 from bavix/l55
Browse files Browse the repository at this point in the history
patch laravel 5.5
  • Loading branch information
rez1dent3 authored Nov 9, 2018
2 parents 3242917 + ff8d6bc commit 2a11a16
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ language: php
php:
- '7.1'
- '7.2'
- '7.3'

before_script:
- "composer install"
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
],
"require": {
"php": "^7.1",
"laravel/framework": "~5.5.0|~5.6.0|~5.7.0"
"laravel/framework": "~5.5.0|~5.6.0|~5.7.0",
"ramsey/uuid": "^3.0"
},
"require-dev": {
"doctrine/dbal": "^2.8",
Expand Down
8 changes: 5 additions & 3 deletions src/Traits/HasWallet.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Ramsey\Uuid\Uuid;

/**
* Class HasWallet
Expand Down Expand Up @@ -141,6 +141,7 @@ public function forceTransfer(Wallet $wallet, int $amount, ?array $meta = null):
* @param Transaction $withdraw
* @param Transaction $deposit
* @return Transfer
* @throws
*/
protected function assemble(Wallet $wallet, Transaction $withdraw, Transaction $deposit): Transfer
{
Expand All @@ -154,7 +155,7 @@ protected function assemble(Wallet $wallet, Transaction $withdraw, Transaction $
'from_id' => $this->getKey(),
'to_type' => $wallet->getMorphClass(),
'to_id' => $wallet->getKey(),
'uuid' => Str::uuid()->toString(),
'uuid' => Uuid::uuid4()->toString(),
]);
}

Expand All @@ -163,6 +164,7 @@ protected function assemble(Wallet $wallet, Transaction $withdraw, Transaction $
* @param array|null $meta
* @param bool $confirmed
* @return Transaction
* @throws
*/
protected function change(int $amount, ?array $meta, bool $confirmed): Transaction
{
Expand All @@ -172,7 +174,7 @@ protected function change(int $amount, ?array $meta, bool $confirmed): Transacti
'type' => $amount > 0 ? 'deposit' : 'withdraw',
'payable_type' => $this->getMorphClass(),
'payable_id' => $this->getKey(),
'uuid' => Str::uuid()->toString(),
'uuid' => Uuid::uuid4()->toString(),
'confirmed' => $confirmed,
'amount' => $amount,
'meta' => $meta,
Expand Down

0 comments on commit 2a11a16

Please sign in to comment.