From 7a3b24fc0df67d86e8487083cb69a1011722617e Mon Sep 17 00:00:00 2001 From: Achmad Hadi Kurnia Date: Thu, 18 Jul 2024 08:07:32 +0700 Subject: [PATCH 1/2] fix command description --- src/Commands/GenerateTokenCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Commands/GenerateTokenCommand.php b/src/Commands/GenerateTokenCommand.php index 471d36a..bd42b24 100644 --- a/src/Commands/GenerateTokenCommand.php +++ b/src/Commands/GenerateTokenCommand.php @@ -11,7 +11,7 @@ class GenerateTokenCommand extends Command protected $signature = 'siasn:token {--fresh : Always request a new token}'; - protected $description = 'Generate an APIM and SSO Token'; + protected $description = 'Generate an APIM and SSO Tokens'; public function handle(): int { From 1de6c3efd1817265f786eda1c4ca2623bb14d405 Mon Sep 17 00:00:00 2001 From: Achmad Hadi Kurnia Date: Thu, 18 Jul 2024 08:07:52 +0700 Subject: [PATCH 2/2] Update readme --- README.md | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 502b357..eabf41a 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ Generate an SSO Token php artisan siasn:sso-token ``` -Generate an APIM and SSO Token +Generate an APIM and SSO Tokens ```bash php artisan siasn:token @@ -138,15 +138,30 @@ php artisan siasn:token You can add the `--fresh` option to always request a new token -### Remove Token +### Remove Tokens -Remove an APIM and SSO Token +Remove an APIM and SSO Tokens ```bash php artisan siasn:forget-token ``` -### Send Request +### Available Token Methods + +Generate an APIM Token + +```php +Token::getNewApimToken(); // Always request a new APIM token +Token::getApimToken(); // Request a new APIM token + +Token::getNewSsoToken(); // Always request a new SSO token +Token::getSsoToken(); // Request a new SSO token + +Token::forget(); // Remove APIM and SSO Tokens +``` + +### Send a Request +Using Command Send a GET request to endpoint of SIASN API @@ -166,9 +181,9 @@ Send a POST request to endpoint of SIASN API php artisan siasn:post {endpoint} ``` -### Using Class +### Send a Request Using Class -The Siasn class uses the Http class (Illuminate\Support\Facades\Http) from Laravel. So you can use it just like you would use that class. +The Siasn class uses the `Http` class (`Illuminate\Support\Facades\Http`) from Laravel. So you can use it just like you would use that class. ```php Siasn::get($endpoint, $params)