<?php

use Illuminate\Database\Seeder;
use App\Models\ElementsDensity as ElementsDensityModel;

class ElementsDensityDataSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
    	ElementsDensityModel::truncate();
    	$elements = [
    		'copper',
    		'silver',
    		'gold',
    		'platinum'
    	];

        foreach ($elements as $value) {
        	$new_elements = new ElementsDensityModel;
        	$new_elements->elements = $value;
        	$new_elements->density = rand(10,50);
        	$new_elements->save();
        }
    }
}
