InhabitantClassificationSeeder.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace Database\Seeders;
  3. use App\Models\InhabitantClassification;
  4. use Illuminate\Database\Seeder;
  5. class InhabitantClassificationSeeder extends Seeder
  6. {
  7. public function run(): void
  8. {
  9. $classifications = [
  10. ['description' => '50k', 'start' => 1, 'end' => 3, 'tbr_percentage' => 0.0000],
  11. ['description' => '50k', 'start' => 4, 'end' => 12, 'tbr_percentage' => 0.4000],
  12. ['description' => '50k', 'start' => 13, 'end' => 60, 'tbr_percentage' => 0.6000],
  13. ['description' => '50k - 100k', 'start' => 1, 'end' => 3, 'tbr_percentage' => 0.0000],
  14. ['description' => '50k - 100k', 'start' => 4, 'end' => 12, 'tbr_percentage' => 0.5000],
  15. ['description' => '50k - 100k', 'start' => 13, 'end' => 60, 'tbr_percentage' => 0.7500],
  16. ['description' => '100k - 200k', 'start' => 1, 'end' => 3, 'tbr_percentage' => 0.0000],
  17. ['description' => '100k - 200k', 'start' => 4, 'end' => 12, 'tbr_percentage' => 0.7500],
  18. ['description' => '100k - 200k', 'start' => 13, 'end' => 60, 'tbr_percentage' => 0.1000],
  19. ['description' => '> 200k', 'start' => 1, 'end' => 3, 'tbr_percentage' => 0.0000],
  20. ['description' => '> 200k', 'start' => 4, 'end' => 12, 'tbr_percentage' => 1.0000],
  21. ['description' => '> 200k', 'start' => 13, 'end' => 60, 'tbr_percentage' => 1.5000],
  22. ];
  23. foreach ($classifications as $item) {
  24. InhabitantClassification::firstOrCreate(
  25. ['description' => $item['description'], 'start' => $item['start'], 'end' => $item['end']],
  26. $item,
  27. );
  28. }
  29. }
  30. }