<?php

use App\Models\Picture;
use Illuminate\Database\Seeder;

class PicturesTableSeeder extends Seeder
{
    protected $pictures = [
        ['items/item_1/22zdHJbBxGDQW1LUovIR9cRh55JOZXxnGC0dfiZ2.jpeg', '1', 'images.jpg', 'jpg', '8365'],
        ['items/item_1/874zEXsQiubYhpNPAg89FIkbFWD3hZW2ZhenvoJB.jpeg', '1', 'IMG_9961-800x533.jpg', 'jpg', '104971'],
        ['items/item_1/SzqgP2HrnGoXcVngqcRoiUd1GZED6nUlCjPy2kfi.jpeg', '1', 'IMG_9958-800x533.jpg', 'jpg', '72487'],
        ['items/item_2/7jXFZeTeRmye310p0CGKOgCzNOOhjlNihCk0YAYo.jpeg', '2', 'e9e88da21518a80899f2e6341596a047.jpg', 'jpg', '90431'],
        ['items/item_2/ldsa7DohFifkx2opL97egxwFtDBpVQ9LUhHIVBPC.jpeg', '2', '26028609_images_2333157737.jpg', 'jpg', '62762'],
        ['items/item_2/rcTXGcQZwfCnXSYwZYMgqdTMmm2VZc1YmeEyBDkn.jpeg', '2', '27372247_10.jpg', 'jpg', '115600'],
        ['items/item_3/Dzmtk2HvXisKvxVMbQptcCh4Nuavo0CDjbX2c3QE.jpeg', '3', 'televizor-berezka[0].jpg', 'jpg', '25954'],
        ['items/item_3/F8Cd2XcCZAvOxYbt5wmwTKWVM5PeBeHkJc8gaquE.jpeg', '3', 'televizor-berezka[1].jpg', 'jpg', '89642'],
        ['items/item_3/G9G218Rq7hhrP13zCtWoxdduT0Tltwgl4iujtw70.jpeg', '3', 'televizor-berezka[2].jpg', 'jpg', '28420'],
        ['items/item_4/EasVr7fjaGlZEg27QB9GW7XTKRcZprEVuJBq6bVF.jpeg', '4', 'image006.jpg', 'jpg', '120583'],
        ['items/item_4/Kw0VpASepkrbp8b1d64wysmMtQgHAlABNzTeTIE2.jpeg', '4', 'klipart-knigi-v-vektore.jpg', 'jpg', '35665'],
        ['items/item_4/LYei3CegaO90jeHoNPwqvvIIY808dQSRY6EWSbzq.jpeg', '4', 'bucher.jpg', 'jpg', '126017'],
        ['items/item_5/29ks3DPuCbKKpxnRVk6nXr9PO4a80pjQhwDkgDBm.jpeg', '5', 'rizhii_kot.jpg', 'jpg', '7317'],
        ['items/item_5/8JxRYIYQCwxEev2lcprwSP3VxxvbGJRcmtvdvdxA.jpeg', '5', 'rizhii_kot-0.jpg', 'jpg', '80659'],
        ['items/item_5/fMmIT28ugwoycemGUor09IgfaQ2JDhJjtb0MeXKb.jpeg', '5', 'rizhii_kot-1.jpg', 'jpg', '99020'],
        ['items/item_6/7Pm3icuqHJGczU3OtAo737FE4oXfKcDFmYj7Yrnk.jpeg', '6', 'fotoapparat-canon-400d.jpg','jpg', '234187'],
        ['items/item_6/gNAnsnmyYdY8EFipxjUyrFVBOGYu59hgPqbEsFJp.jpeg', '6', 'fotoapparat-canon-400d.jpg', 'jpg','218345'],
        ['items/item_6/9syEYDd4L651FyrsSsmMWsnmrnE3FoQ3NfZJ2hRa.jpeg', '6', 'fotoapparat-canon-400d.jpg', 'jpg', '466028'],
        ['items/item_7/BHwIfe5zHwf47EVpE15Nz6nHEG8q2pgDT6J6cT8K.jpeg', '7', 'holodos-saumsung[1].jpg', 'jpg', '466028'],
        ['items/item_7/K1dLwLEZOgM9SgNFQacHUdYFa0Mf4nptpQkEUAd4.jpeg', '7', 'holodos-saumsung[2].jpg', 'jpg', '466028'],
        ['items/item_7/xhnHmVSNMHzzq0ibYluJRXnpFrzf2uqK99Ej1sI6.jpeg', '7', 'holodos-saumsung[3].jpg', 'jpg', '466028'],
        ['items/item_8/lN5nQKCc9tpJBw5LTMF0LluuEvbZNTJQGGInobpa.jpeg', '8', 'shapka.jpg', 'jpg', '466028']
    ];

    protected $columnNames = ['path', 'item_id', 'real_name', 'mime_type', 'size'];


    /**
     * Run the database seeds.
     *
     * @return void
    //     */
    public function run()
    {
        $newArray = [];
        foreach ($this->pictures as $picture) {
            foreach ($picture as $key => $value) {
                $newArray[$this->columnNames[$key]] = $value;
            }
            Picture::create($newArray);
        }
    }
}