HEX
Server: nginx/1.24.0
System: Linux DGT-WORDPRESS-VM-SERVER 6.14.0-1014-azure #14~24.04.1-Ubuntu SMP Fri Oct 3 20:52:11 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 8.4.12
Disabled: NONE
Upload Files
File: /mnt/data/ghayatcom/ghayatcom-api/database/seeders/DietaryRestrictionsSeeder.php
<?php

namespace Database\Seeders;

use App\DietaryRestrictions;
use Illuminate\Database\Seeder;

class DietaryRestrictionsSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $datas = [
            1 => ['name' => 'None', 'created_by' => 1, 'updated_by' => 1],
            2 => ['name' => 'Ovo-Vegetarian (eat eggs, but not dairy)', 'created_by' => 1, 'updated_by' => 1],
            3 => ['name' => 'Lacto-Vegetarian (eat dairy, but not eggs)', 'created_by' => 1, 'updated_by' => 1],
            4 => ['name' => 'Vegetarian (eat both dairy and eggs)', 'created_by' => 1, 'updated_by' => 1],
            5 => ['name' => 'Vegan (no meat or animal products)', 'created_by' => 1, 'updated_by' => 1],
            6 => ['name' => 'Pescatarian (no meat, except fish)', 'created_by' => 1, 'updated_by' => 1],
            7 => ['name' => 'Gluten Free (no wheat, barley or rye)', 'created_by' => 1, 'updated_by' => 1],
            8 => ['name' => 'Lactose Intolerant (lactose-free dairy)', 'created_by' => 1, 'updated_by' => 1],
        ];

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