<?php

namespace Database\Seeders;

use App\Models\Benefit;
use App\Models\MemberBenefit;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class BenefitSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $member_benefits = MemberBenefit::pluck('benefit_code')->unique();

        foreach ($member_benefits as $benefit_code) {
            Benefit::create([
                'code' => $benefit_code,
                'name' => "Benefit ". $benefit_code,
                'corporate_id' => 3,
            ]);
        }
    }
}
