<?php

use App\Category;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;

class CategoryDescriptionSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        foreach (Category::cursor() as $category){
            DB::table('category_descriptions')->insert([
                [
                    'name' => Str::random(16),
                    'slug' => Str::slug(Str::random(10) ,'-'),
                    'keywords' => Str::random(10),
                    'meta_description' => Str::random(10),
                    'category_id' => $category->id,
                    'language_id' => 1
                ],
                [
                    'name' => Str::random(16),
                    'slug' => Str::slug(Str::random(10) ,'-'),
                    'keywords' => Str::random(10),
                    'meta_description' => Str::random(10),
                    'category_id' => $category->id,
                    'language_id' => 2
                ]
            ]);
        }
    }
}
