database/seeders/ContactsSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        $accounts = Account::factory()
            ->count(50)
            ->create();
        foreach ($accounts as $account) {
            Subscription::factory()->create([
                "account_id" => $account->id,
            ]);
            $bill = Billing::factory()->create([
                "account_id" => $account->id,
            ]);
            Transaction::factory()->create([
                "bill_id" => $bill->id,
                "account_id" => $account->id,
            ]);
            Attendance::factory()->count(40)->create([
                "account_id" => $account->id,
            ]);
        }
    }
public function run ( ) { $ accounts = Account :: factory ( ) -> count ( 50 ) -> create ( ) ; foreach ( $ accounts as $ account ) { Subscription :: factory ( ) -> create ( [ " account_id " => $ account -> id , ] ) ; $ bill = Billing :: factory ( ) -> create ( [ " account_id " => $ account -> id , ] ) ; Transaction :: factory ( ) -> create ( [ " bill_id " => $ bill -> id , " account_id " => $ account -> id , ] ) ; Attendance :: factory ( ) -> count ( 40 ) -> create ( [ " account_id " => $ account -> id , ] ) ; } }
Run the database seeds.
Run the database seeds .