This commit is contained in:
2022-07-12 13:23:27 +07:00
parent b5f892641d
commit 4e99ba5109
29 changed files with 1826 additions and 228 deletions

View File

@@ -2,6 +2,8 @@
namespace Database\Seeders;
use App\Models\Benefit;
use App\Models\MemberBenefit;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
@@ -14,37 +16,14 @@ class BenefitSeeder extends Seeder
*/
public function run()
{
$listOfBenefit = [
[
"service_code" => 'OP',
"code" => "GP",
"name" => "General Practitioner",
"description" => "Consultation With General Practitioner"
],
[
"service_code" => 'OP',
"code" => "GP",
"name" => "General Practitioner",
"description" => "Consultation With General Practitioner"
],
[
"service_code" => 'OP',
"code" => "GP",
"name" => "General Practitioner",
"description" => "Consultation With General Practitioner"
],
[
"service_code" => 'OP',
"code" => "GP",
"name" => "General Practitioner",
"description" => "Consultation With General Practitioner"
],
[
"service_code" => 'OP',
"code" => "GP",
"name" => "General Practitioner",
"description" => "Consultation With General Practitioner"
],
];
$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,
]);
}
}
}