Initial commit

This commit is contained in:
Zdeněk Burda
2026-01-09 21:26:40 +01:00
parent e83aec6dca
commit 41e3ce6f25
404 changed files with 61250 additions and 28 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use App\Models\CountryWwl;
class CountriesWwlSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
CountryWwl::truncate();
$heading = true;
$input_file = fopen(base_path("database/seeders/countries_wwl.csv"), "r");
while (($record = fgetcsv($input_file, 10000, ";", '"', '\\')) !== FALSE)
{
if (!$heading)
{
$wwl = array(
"country_name" => $record['0'],
"wwl" => $record['1']
);
CountryWwl::create($wwl);
}
$heading = false;
}
fclose($input_file);
}
}