<?php

use Illuminate\Database\Seeder;

class OccasionDescriptionSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        foreach (\App\Category::cursor() as $category) {
            factory(\App\Occasion::class, 3)->create(); //['category_id' => $category->id]
        }

        foreach (\App\Occasion::cursor() as $occasion) {
            foreach (languages() as $language) {
                factory(\App\OccasionDescription::class)->create(
                    [
                        'occasion_id' => $occasion->id,
                        'language_id' => $language->id,
                    ]
                );
            }
        }
    }
}
