Skip to content

Commit

Permalink
chore: seeder de carteira
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabrielcefetzada committed Jun 4, 2024
1 parent 901b066 commit e62ffe7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
1 change: 1 addition & 0 deletions database/seeders/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public function run(): void

if (App::Environment('local')) {
$this->call(UserSeeder::class);
$this->call(WalletSeeder::class);
}
}
}
6 changes: 3 additions & 3 deletions database/seeders/UserSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public function run(): void
'cpf' => '59335481033',
'cnpj' => '69883236000110'
])->assignRole('store-keeper');
;

User::factory()->create([
$commonUser = User::factory()->make([
'name' => 'Jolene Usuario Comum',
'email' => '[email protected]',
'cpf' => '89853444046',
'cnpj' => null
])->assignRole('common-user');
;

$commonUser->saveQuietly();
}
}
20 changes: 20 additions & 0 deletions database/seeders/WalletSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace Database\Seeders;

use App\Models\Wallet;
use Illuminate\Database\Seeder;

class WalletSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
Wallet::factory()->create([
'balance' => 10000,
'user_id' => 3
]);
}
}

0 comments on commit e62ffe7

Please sign in to comment.