-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:MannikJ/laravel-wallet
- Loading branch information
Showing
35 changed files
with
195 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "Laradock", | ||
"dockerComposeFile": ["../../laradock/docker-compose.yml"], | ||
"service": "workspace", | ||
"workspaceFolder": "/var/www/laravel-wallet", | ||
"extensions": [ | ||
"dotjoshjohnson.xml", | ||
"ryu1kn.partial-diff", | ||
"artdiniz.quitcontrol-vscode", | ||
"emallin.phpunit", | ||
"eamodio.gitlens", | ||
"onecentlin.laravel-extension-pack", | ||
"onecentlin.php-productive-pack", | ||
"sdras.vue-vscode-extensionpack", | ||
"fknop.vscode-npm", | ||
"apility.beautify-blade" | ||
], | ||
"remoteUser": "laradock", | ||
"shutdownAction": "none", | ||
"runServices": ["mysql", "redis", "nginx"] | ||
} |
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file modified
0
database/migrations/2018_09_13_123456_create_wallet_tables.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2018_11_05_123456_update_wallet_transactions_table.php
100644 → 100755
Empty file.
Empty file modified
0
database/migrations/2019_01_25_000000_add_polymorphic_relation_to_transactions_table.php
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace MannikJ\Laravel\Wallet\Tests\Factories; | ||
|
||
use Faker\Generator as Faker; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
use MannikJ\Laravel\Wallet\Models\Transaction; | ||
use MannikJ\Laravel\Wallet\Models\Wallet; | ||
|
||
class TransactionFactory extends Factory | ||
{ | ||
|
||
protected $model = Transaction::class; | ||
|
||
|
||
public function definition() | ||
{ | ||
return [ | ||
'wallet_id' => WalletFactory::new(), | ||
'type' => $this->faker->randomElement([ | ||
'deposit', | ||
'withdraw', | ||
]), | ||
'amount' => $this->faker->randomFloat(4, 0, 10000), | ||
]; | ||
} | ||
|
||
public function withdraw() | ||
{ | ||
return $this->state(function (array $attributes) { | ||
return ['type' => 'withdraw']; | ||
}); | ||
} | ||
|
||
public function deposit() | ||
{ | ||
return $this->state(function (array $attributes) { | ||
return ['type' => 'deposit']; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace MannikJ\Laravel\Wallet\Tests\Factories; | ||
|
||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
use MannikJ\Laravel\Wallet\Tests\Models\User; | ||
use Illuminate\Support\Str; | ||
|
||
class UserFactory extends Factory | ||
{ | ||
protected $model = User::class; | ||
|
||
public function definition() | ||
{ | ||
return [ | ||
'name' => $this->faker->name, | ||
'email' => $this->faker->unique()->safeEmail, | ||
'email_verified_at' => now(), | ||
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password | ||
'remember_token' => Str::random(10), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace MannikJ\Laravel\Wallet\Tests\Factories; | ||
|
||
use MannikJ\Laravel\Wallet\Models\Wallet; | ||
use MannikJ\Laravel\Wallet\Tests\Models\User; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
|
||
class WalletFactory extends Factory | ||
{ | ||
|
||
protected $model = Wallet::class; | ||
|
||
public function definition() | ||
{ | ||
return [ | ||
'owner_id' => UserFactory::new(), | ||
'owner_type' => User::class | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.