this repo has no description
1<?php
2
3namespace Database\Seeders;
4
5use App\Models\Account;
6use App\Models\Institution;
7use App\Models\Transaction;
8use App\Models\User;
9use App\Models\UserAccount;
10use Illuminate\Database\Console\Seeds\WithoutModelEvents;
11use Illuminate\Database\Seeder;
12
13class DatabaseSeeder extends Seeder
14{
15 use WithoutModelEvents;
16
17 /**
18 * Seed the application's database.
19 */
20 public function run(): void
21 {
22 // User::factory(10)->create();
23
24 User::factory()->create([
25 "name" => "Test User",
26 "email" => "test@example.com",
27 ]);
28
29 $user = User::find(1);
30
31 $institutions = Institution::factory(10)->create();
32
33 $accounts = Account::factory(10)->create();
34
35 foreach ($accounts as $account) {
36 UserAccount::create([
37 "user_id" => $user->id,
38 "account_id" => $account->id,
39 ]);
40 }
41
42 Transaction::factory(200)->create();
43 }
44}