<?php

use Illuminate\Database\Seeder;

class DocumentationRequestSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        foreach (\App\City::cursor() as $city) {
            foreach (\App\User::where('role', 'user')->cursor() as $user) {
                foreach (\App\Documentation::where('type', 'outside_office')->cursor() as $document) {
                    foreach (\App\DocumentationType::cursor() as $docType) {
                        factory(\App\DocumentationRequest::class)->create([
                            'type' => 'outside_office',
                            'city_id' => $city->id,
                            'user_id' => $user->id,
                            'user_name' => $user->name,
                            'user_phone' => $user->phone,
                            'user_email' => $user->email,
                            'documentation_date' => $document->documentation_date,
                            'documentation_time' => $document->documentation_time,
                            'documentation_type_id' => $docType->id,
                            'total' => $city->price,
                        ]);
                    }

                }

            }

        }

        foreach (\App\City::cursor() as $city) {
            foreach (\App\User::where('role', 'user')->cursor() as $user) {
                foreach (\App\Documentation::where('type', 'inside_office')->cursor() as $document) {
                    foreach (\App\DocumentationType::cursor() as $docType) {
                        factory(\App\DocumentationRequest::class)->create([
                            'type' => 'inside_office',
                            'user_id' => $user->id,
                            'user_name' => $user->name,
                            'user_phone' => $user->phone,
                            'user_email' => $user->email,
                            'documentation_date' => $document->documentation_date,
                            'documentation_time' => $document->documentation_time,
                            'documentation_type_id' => $docType->id,
                            'total' => $city->price,
                        ]);
                    }

                }

            }

        }
    }
}
