<?php

namespace Database\Seeders;

use App\Media;
use Illuminate\Database\Seeder;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;

class MediaSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $array = [1,2,3,4,5,6,7,8,9];
        $ext = [".mp4",".avi",".mov"];
        for($i=0;$i<50;$i++){
            DB::table('medias')
                ->insert([
                    'gest_sect_id' => Arr::random($array),
                    'dep_id' => Arr::random($array),
                    'miniature' => Str::random(10).'.jpg',
                    'ext' => Arr::random($ext),
                    'url' => 'uploads/videos/git3/'.Str::random(10).'',
                    'duree_video' => now(),
                    'rate'=> 50
                ]
            );
        }
    }
}
