From 56a998dffa4c1721d10835720c30bda07886e8b8 Mon Sep 17 00:00:00 2001 From: Muhammad Fajar Date: Fri, 4 Nov 2022 14:30:41 +0700 Subject: [PATCH] fix organization seeder --- database/seeders/OrganizationSeeder.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/database/seeders/OrganizationSeeder.php b/database/seeders/OrganizationSeeder.php index e3b4be3c..9a169be5 100755 --- a/database/seeders/OrganizationSeeder.php +++ b/database/seeders/OrganizationSeeder.php @@ -16,20 +16,20 @@ class OrganizationSeeder extends Seeder */ public function run() { - $response = Http::get('https://api.primaya.id/temp/organizations'); + $response = Http::get('https://app.primaya.id/temp/organizations'); foreach ($response->json()['organizations'] as $organization) { $newOrganization = Organization::updateOrCreate([ - 'code' => 'ORG000'.$organization['code'], - ],[ - 'code' => 'ORG000'.$organization['code'], + 'code' => 'ORG000' . $organization['code'], + ], [ + 'code' => 'ORG000' . $organization['code'], 'name' => $organization['name'], 'type' => 'hospital', ]); $newAddress = $newOrganization->addresses()->updateOrCreate([ 'id' => $newOrganization->main_address_id - ],[ + ], [ 'use' => 'both', 'type' => 'physical', 'text' => $organization['address'], @@ -49,14 +49,15 @@ class OrganizationSeeder extends Seeder ]); $newOrganization->metas()->updateOrCreate([ 'type' => 'phone', - ],[ + ], [ 'system' => 'default', 'type' => 'phone', 'value' => $organization['phone'] ]); $newOrganization->metas()->updateOrCreate([ 'type' => 'timezone', - ],['system' => 'default', + ], [ + 'system' => 'default', 'type' => 'timezone', 'value' => $organization['timezone'] ]);