A Laravel package for seamless integration with the SIASN REST API. This library is the abstraction of SIASN API for access from applications written with Laravel PHP Framework.
Want to provide tangible support? Use the following platforms to contribute to open-source software development:
Your support is greatly appreciated!
Install the package via Composer:
composer require kanekescom/laravel-siasn-api
Publish the config file:
php artisan vendor:publish --tag="siasn-api-config"
Or complete all installations with:
php artisan siasn-api:install
Generate APIM Token:
php artisan siasn:apim-token
Generate SSO Token:
php artisan siasn:sso-token
Generate both APIM and SSO Tokens:
php artisan siasn:token
Use --fresh
to always request a new token.
php artisan siasn:forget-token
use Kanekes\Siasn\Api\Credentials\Token;
Token::getNewApimToken(); // Always request a new APIM token
Token::getApimToken(); // Request APIM token
Token::getNewSsoToken(); // Always request a new SSO token
Token::getSsoToken(); // Request SSO token
Token::forget(); // Remove APIM and SSO tokens
php artisan siasn:get {endpoint}
Example:
php artisan siasn:get https://apimws.bkn.go.id:8243/apisiasn/1.0/referensi/ref-unor
php artisan siasn:post {endpoint}
The Siasn
class uses Laravel's Http
class (Illuminate\Support\Facades\Http
):
use Kanekes\Siasn\Api\Facades\Siasn;
Siasn::get($endpoint, $params);
For dual authentication (SSO), use:
use Kanekes\Siasn\Api\Facades\Siasn;
Siasn::withSso()->get($endpoint, $params);
composer test
See CHANGELOG for recent updates.
See CONTRIBUTING for contribution guidelines.
See our security policy on how to report security vulnerabilities.
The MIT License (MIT). See License File for details.