beginTransaction(); // 管理者ログインユーザーの作成 $user = User::whereEmail("admin@aa.com") ->firstOrNew(); $user->name = "管理者"; $user->email = "admin@aa.com"; $user->role = UserRole::ADMIN; $user->password = "testuser"; $user->save(); // 管理者ログインユーザーの作成 $user = User::whereEmail("hello@gmail.com") ->firstOrNew(); $user->name = "ハローテクノ管理者"; $user->email = "hello@gmail.com"; $user->role = UserRole::ADMIN; $user->password = "hellouser"; $user->save(); $db->commit(); } catch (Exception $e) { $db->rollBack(); throw $e; } return self::RESULTCODE_SUCCESS; } }