PHPackages                             bkpsdm-karawang/sim-asn-php-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. bkpsdm-karawang/sim-asn-php-client

ActiveLibrary

bkpsdm-karawang/sim-asn-php-client
==================================

PHP Client for SIM-ASN Service BKPSDM Karawang

4.1.0(5mo ago)0782[1 issues](https://github.com/bkpsdm-karawang/sim-asn-php-client/issues)MITPHPPHP ^8.3

Since Oct 28Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/bkpsdm-karawang/sim-asn-php-client)[ Packagist](https://packagist.org/packages/bkpsdm-karawang/sim-asn-php-client)[ Docs](https://sim-asn.bkpsdm.karawangkab.go.id)[ RSS](/packages/bkpsdm-karawang-sim-asn-php-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (40)Used By (0)

SIM-ASN PHP Client
==================

[](#sim-asn-php-client)

This is php client SDK for SIM-ASN BKPSDM Kabupaten Karawang api services

Installation
------------

[](#installation)

require this package via composer

```
composer require bkpsdm-karawang/sim-asn-php-client

```

add environment value to `.env`

```
SIM_ASN_CLIENT_ID=xxxx
SIM_ASN_CLIENT_SECRET=xxxx
```

We recomend add two field to user table

```
    $table->uuid('sim_asn_user_id')->nullable()->default(null);
    $table->json('sim_asn_token')->nullable()->default(null);
```

Add refresh token handler in boot of `AppServiceProvider.php`

```
    use SIM_ASN\Laravel\Facades\UserClient;
    use SIM_ASN\Models\AccessToken;
    ...
    /**
     * Register any application services.
     *
     * @return void
     */
    public function boot(Request $request)
    {
        $user = $request->user();

        if ($user) {
            if ($user->sim_asn_token) {
                UserClient::setAccessToken($user->sim_asn_token);
            }

            UserClient::onRefreshToken(function(AccessToken $accessToken) use ($user) {
                $user->sim_asn_token = $accessToken;
                $user->save();
            });
        }
    }
```

Usage
-----

[](#usage)

Create callback handler route

```
    use SIM_ASN\Laravel\Facades\OauthClient;
    use SIM_ASN\Models\AccessToken;
    use SIM_ASN\Models\User as UserSimASN;

    /**
     * callback sim-asn
     */
    public function callbackSimASN(Request $request)
    {
        return OauthClient::handleCallback($request, function (UserSimASN $userSimASN, AccessToken $token) {
            $user = User::whereSimAsnUserId($userSimASN->id)->first();

            if ($user) {
                $user->sim_asn_token = $token;
                $user->save();
                return Auth::login($user);
            }

            return null;
        });
    }
```

Manualy get access token by response code

```
$accessToken = OauthClient::requestAccessToken($request->code);
```

Get user profile

```
$user = UserClient::setAccessToken($accessToken)->getUser();
```

App Client or User Client is extended class from guzzle client so you can directly use http guzzle client

```
use SIM_ASN\Laravel\Facades\AppClient;
...
AppClient::get('/api/endpoint');
AppClient::post('/api/endpoint', [
    'body' => ['foo' => 'bar']
]);
```

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance70

Regular maintenance activity

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~39 days

Recently: every ~44 days

Total

39

Last Release

174d ago

Major Versions

1.1.6 → 2.0.02023-02-25

1.1.7 → 2.1.02023-08-25

2.1.4 → 3.0.02024-05-25

3.1.4 → 4.0.02025-05-05

PHP version history (4 changes)1.0.0PHP ^7.3

2.0.0PHP ^8.1

3.0.0PHP ^8.2

4.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/f1d435667fc352550ae83aa4c4b8977402b51984915409312214dc25d55ef304?d=identicon)[denmasyarikin](/maintainers/denmasyarikin)

---

Top Contributors

[![dedenmaulana](https://avatars.githubusercontent.com/u/4162864?v=4)](https://github.com/dedenmaulana "dedenmaulana (25 commits)")[![denmasyarikin](https://avatars.githubusercontent.com/u/18554343?v=4)](https://github.com/denmasyarikin "denmasyarikin (25 commits)")

---

Tags

sim asnbkpsdmkarawang

### Embed Badge

![Health badge](/badges/bkpsdm-karawang-sim-asn-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/bkpsdm-karawang-sim-asn-php-client/health.svg)](https://phpackages.com/packages/bkpsdm-karawang-sim-asn-php-client)
```

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k49.4M479](/packages/laravel-scout)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

264778.4k3](/packages/laravel-cashier-paddle)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
