| 12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace Database\Seeders;
- use App\Models\InhabitantClassification;
- use Illuminate\Database\Seeder;
- class InhabitantClassificationSeeder extends Seeder
- {
- public function run(): void
- {
- $classifications = [
- ['description' => '50k', 'start' => 1, 'end' => 3, 'tbr_percentage' => 0.0000],
- ['description' => '50k', 'start' => 4, 'end' => 12, 'tbr_percentage' => 0.4000],
- ['description' => '50k', 'start' => 13, 'end' => 60, 'tbr_percentage' => 0.6000],
- ['description' => '50k - 100k', 'start' => 1, 'end' => 3, 'tbr_percentage' => 0.0000],
- ['description' => '50k - 100k', 'start' => 4, 'end' => 12, 'tbr_percentage' => 0.5000],
- ['description' => '50k - 100k', 'start' => 13, 'end' => 60, 'tbr_percentage' => 0.7500],
- ['description' => '100k - 200k', 'start' => 1, 'end' => 3, 'tbr_percentage' => 0.0000],
- ['description' => '100k - 200k', 'start' => 4, 'end' => 12, 'tbr_percentage' => 0.7500],
- ['description' => '100k - 200k', 'start' => 13, 'end' => 60, 'tbr_percentage' => 0.1000],
- ['description' => '> 200k', 'start' => 1, 'end' => 3, 'tbr_percentage' => 0.0000],
- ['description' => '> 200k', 'start' => 4, 'end' => 12, 'tbr_percentage' => 1.0000],
- ['description' => '> 200k', 'start' => 13, 'end' => 60, 'tbr_percentage' => 1.5000],
- ];
- foreach ($classifications as $item) {
- InhabitantClassification::firstOrCreate(
- ['description' => $item['description'], 'start' => $item['start'], 'end' => $item['end']],
- $item,
- );
- }
- }
- }
|