<?php

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

class ArticleDescriptionSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        foreach (Article::cursor() as $article){
            foreach (languages() as $language){
                DB::table('article_descriptions')->insert([
                    [
                        'title' => Str::random(16),
                        'description' => Str::random(16),
                        'slug' => Str::slug(Str::random(10) ,'-'),
                        'meta_description' => Str::random(16),
                        'keywords' => Str::random(16),
                        'article_id' => $article->id,
                        'language_id' => $language->id,
                    ],
                ]);
            }

        }
    }
}
