<?php

use Illuminate\Database\Seeder;

class ServiceSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $images = [
            [
                'assets/web/images/icons/ser_pg/4.svg',
                'assets/web/images/icons/ser_pg/4.svg',
            ],
            [
                'assets/web/images/icons/ser_pg/1.svg',
                'assets/web/images/icons/ser_pg/1.svg',
            ],
            [
                'assets/web/images/icons/ser_pg/5.svg',
                'assets/web/images/icons/ser_pg/5.svg'
            ],
            [
                'assets/web/images/icons/ser_pg/7.svg',
                'assets/web/images/icons/ser_pg/7.svg'
            ],
            [
                'assets/web/images/icons/ser_pg/2.svg',
                'assets/web/images/icons/ser_pg/2.svg'
            ],
            [
               'assets/web/images/icons/ser_pg/6.svg',
               'assets/web/images/icons/ser_pg/6.svg'
            ],
            [
                'assets/web/images/icons/ser_pg/8.svg',
                'assets/web/images/icons/ser_pg/8.svg'
            ],
            [
                'assets/web/images/icons/ser_pg/9.svg',
                'assets/web/images/icons/ser_pg/9.svg'
            ],
            [
                'assets/web/images/icons/ser_pg/3.svg',
                'assets/web/images/icons/ser_pg/3.svg'
            ],
        ];

        foreach ($images as $image) {
            factory(\App\Service::class)->create([
                'images' => $image
            ]);
        }

        foreach (\App\Service::cursor() as $service) {
            foreach (languages() as $language) {
                factory(\App\ServiceDescription::class)->create([
                    'service_id' => $service->id,
                    'language_id' => $language->id,
                ]);
            }
        }

    }
}
