<?php

use Illuminate\Database\Seeder;
use App\Models\PetPopularity as PetPopularityModel;

class PetPopularitySeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
    	PetPopularityModel::truncate();
    	$pets = [
    		'Dogs',
    		'Cats',
    	];

    	foreach (range(1,50) as $value) {
    		foreach ($pets as $pet) {
    			$new_data = new PetPopularityModel;
    			$new_data->pet_name = $pet;
    			$new_data->popularity = rand($value,100);
    			$new_data->save();
    		}
    	}
    }
}
