- What is kanekescom/laravel-siasn-api used for?
- It is a Laravel wrapper around Indonesia's SIASN REST API (BKN), letting Laravel applications read civil-service reference and employee data server-to-server. The package handles configuration, authentication, and request dispatch so you do not hand-roll HTTP calls against SIASN. It is aimed at Laravel monoliths or modular monoliths that already own HR/ASN domain data and need to call SIASN from controllers or jobs.
- How do I install laravel-siasn-api in a Laravel project?
- Install it with Composer using composer require kanekescom/laravel-siasn-api, then publish the package configuration file with the artisan vendor:publish command. Add your SIASN credentials to the environment file and resolve the provided Siasn facade or injected client. Confirm your PHP and Laravel versions satisfy the constraints in the package's composer.json before adopting it.
- Which Laravel and PHP versions does laravel-siasn-api support?
- The package targets PHP 8.x and a Laravel version consistent with its composer.json constraints, so check those constraints before adoption rather than assuming your version is supported. Run composer why-not kanekescom/laravel-siasn-api to spot conflicts with pinned Guzzle or other HTTP client versions in your app. Because it is a Laravel-specific wrapper, Lumen, Symfony, or non-Laravel PHP services should use the underlying HTTP client directly instead of the facade.
- How do I configure SIASN credentials for this package?
- After publishing the config file, supply your institutional SIASN credentials through environment variables, which typically means an API client identifier and secret issued by BKN. Keep these secrets out of version control and rotate them through your standard secret-management process. Note that SIASN access usually also requires registered institutional credentials, IP allowlisting, and network reachability to government endpoints.
- How do I call SIASN endpoints with the Siasn facade?
- Resolve the Siasn facade and call the documented endpoint methods, which map to SIASN REST resources. Version 2.0.21 adds @method docblock annotations to the facade, so PhpStorm, PHPStan, and Larastan can autocomplete and type-check those calls without any runtime change. Refer to the package source or README for the exact method names, since the annotation list mirrors the available endpoints.
- Does laravel-siasn-api handle token refresh, retries, and rate limiting?
- The package handles authentication and request dispatch, but the evaluation notes that retry, backoff, timeout, and rate-limit behavior are not clearly guaranteed and may need to be built. Treat token refresh, circuit breaking, and retry policies as your responsibility at an adapter layer unless the package explicitly documents them. Implement these policies before going live, since SIASN is a closed government API that can throttle or reject bursts.
- How do I test or mock the Siasn facade in Laravel tests?
- A static facade surface is harder to mock, and the package does not appear to ship a dedicated fake, so bind an internal interface such as SiasnGateway in the container and depend on that in your controllers and jobs. That adapter can be swapped for a fake in tests and backed by recorded fixtures rather than the live government sandbox. Contract tests against fixtures keep your suite fast and avoid sending real civil-servant data through test runs.
- Is laravel-siasn-api safe to use in production with personal data?
- SIASN payloads contain civil-servant personal data covered by Indonesia's UU PDP, so you must control logging, retention, and access around every response. Check whether the package logs request or response bodies by default and disable or redact that logging if it does. Add audit logging and PII controls before enabling any write operations, and pilot with read-only lookups first.
- What changed in laravel-siasn-api v2.0.21 and is upgrading safe?
- Version 2.0.21 only adds @method docblock annotations to the Siasn facade to improve IDE and static-analysis support, with no runtime behavior change. Upgrading from v2.0.20 is drop-in because the change is metadata only and cannot affect autoloading or request handling. Verify that the facade class name and namespace stay stable if you reference those signatures in your own PHPStan baseline.
- Is laravel-siasn-api well maintained, and are there alternatives?
- It is a single-maintainer package (kanekescom) tracking a closed, versioned government API, so the main lifecycle risk is upstream API drift without matching releases. Pin the exact version rather than floating ^2.0, watch the repository's release cadence, and consider the bus factor before making it a critical dependency. There is no widely known drop-in alternative, so wrapping the facade behind your own interface is the pragmatic hedge against abandonment or breaking changes.