kanekescom / laravel-siasn-api
A Laravel package for seamless integration with the SIASN REST API
Fund package maintenance!
achmadhadikurnia
Buymeacoffee
Patreon
Saweria
Installs: 2 419
Dependents: 5
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.2
- illuminate/contracts: ^10.0||^11.0
- kanekescom/laravel-helperia: ^2.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.3
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- spatie/laravel-ray: ^1.35
README
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.
Support Us
Want to provide tangible support? Use the following platforms to contribute to open-source software development:
Your support is greatly appreciated!
Installation
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
Usage
Token Generator
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.
Remove Tokens
php artisan siasn:forget-token
Available Token Methods
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
Send a Request Using Commands
GET Request:
php artisan siasn:get {endpoint}
Example:
php artisan siasn:get https://apimws.bkn.go.id:8243/apisiasn/1.0/referensi/ref-unor
POST Request:
php artisan siasn:post {endpoint}
Send a Request Using Class
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);
Testing
composer test
Our Other Cool Packages
Referensi APIs
SIASNAPI-SIMPEG APIs
Changelog
See CHANGELOG for recent updates.
Contributing
See CONTRIBUTING for contribution guidelines.
Security Vulnerabilities
See our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). See License File for details.