HEX
Server: nginx/1.24.0
System: Linux DGT-WORDPRESS-VM-SERVER 6.14.0-1017-azure #17~24.04.1-Ubuntu SMP Mon Dec 1 20:10:50 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 8.4.12
Disabled: NONE
Upload Files
File: /mnt/data/ghayatcom/ghayatcom-api/database/seeders/AlcoholConsumptionSeeder.php
<?php

namespace Database\Seeders;

use App\AlcoholConsumption;
use Illuminate\Database\Seeder;

class AlcoholConsumptionSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $datas = [
            1 => ['name' => 'Not a drinker', 'created_by' => 1, 'updated_by' => 1],
            2 => ['name' => 'Social Drinker (0-7 drinks per week)', 'created_by' => 1, 'updated_by' => 1],
            3 => ['name' => 'Moderate Drinker (8-14 drinks per week)', 'created_by' => 1, 'updated_by' => 1],
            4 => ['name' => 'Heavy Drinker (15+ drinks per week)', 'created_by' => 1, 'updated_by' => 1],
        ];

        foreach ($datas as $id => $data) {
            $row = AlcoholConsumption::firstOrNew([
                'id' => $id,
            ]);
            $row->fill($data);
            $row->save();
        }
    }
}