<?php

use Illuminate\Database\Seeder;

class AddressSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $addresses = factory(\App\Address::class, 2)->create();

        foreach (languages() as $language) {
            foreach ($addresses as $address) {
                factory(\App\AddressDescription::class)->create([
                    'address_id' => $address->id,
                    'language_id' => $language->id,
                ]);
            }
        }
    }
}
