<?php

use App\Testimonial;
use App\TestimonialDescription;
use Illuminate\Database\Seeder;

class TestimonialDescriptionSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        factory(Testimonial::class, 10)->create();

        foreach (Testimonial::cursor() as $testimonial) {
            foreach (languages() as $language){
                factory(TestimonialDescription::class)->create([
                    'testimonial_id' => $testimonial->id,
                    'language_id' => $language->id,
                ]);
            }
        }
    }
}
