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();
}
}
}