From c236c5d50c84a5879bf0b6db7a8e2e06d97c25f0 Mon Sep 17 00:00:00 2001 From: ziming Date: Tue, 5 Jul 2022 18:43:32 +0800 Subject: [PATCH] Add setAttributes() method for better customizability. Might be useful in multi user journey flow. --- src/LaravelMyinfoSg.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/LaravelMyinfoSg.php b/src/LaravelMyinfoSg.php index 40ed724..336d9bd 100755 --- a/src/LaravelMyinfoSg.php +++ b/src/LaravelMyinfoSg.php @@ -250,4 +250,13 @@ private function createPersonRequest(string $sub, string $validAccessToken): \Ps return $response; } + + public function setAttributes(array|string $attributes) + { + if (is_string($attributes)) { + $this->attributes = $attributes; + } elseif (is_array($attributes)) { + $this->attributes = join(',', $attributes); + } + } }