PHPackages                             stellarsecurity/esim-laravel - 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. [API Development](/categories/api)
4. /
5. stellarsecurity/esim-laravel

ActiveLibrary[API Development](/categories/api)

stellarsecurity/esim-laravel
============================

Thin Laravel client for Stellar Simcard API (/v1/sim/\*).

v1.0.1(8mo ago)0215MITPHPPHP ^8.2

Since Dec 11Pushed 2w agoCompare

[ Source](https://github.com/StellarSecurity-Packages/stellarsecurity-esim-laravel)[ Packagist](https://packagist.org/packages/stellarsecurity/esim-laravel)[ RSS](/packages/stellarsecurity-esim-laravel/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (3)DependenciesVersions (3)Used By (0)

stellarsecurity/esim-laravel
============================

[](#stellarsecurityesim-laravel)

Thin Laravel client for the Stellar Simcard API.

The package exposes a typed `SimApiClient` for the existing project-style routes:

```
GET     /v1/sim/plans
POST    /v1/sim/order
POST    /v1/sim/query
POST    /v1/sim/user
PATCH   /v1/sim/user
DELETE  /v1/sim/user
DELETE  /v1/sim/user/all

```

It defines no controllers, application routes, models, migrations, or database tables.

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

[](#installation)

```
composer require stellarsecurity/esim-laravel
```

Laravel auto-discovers the service provider.

Optionally publish its configuration:

```
php artisan vendor:publish --tag=sim-config
```

Configuration
-------------

[](#configuration)

```
SIM_API_BASE_URL=https://your-sim-api.example.com/api
SIM_API_USERNAME=your-basic-auth-username
SIM_API_PASSWORD=your-basic-auth-password

SIM_API_TIMEOUT=35
SIM_API_CONNECT_TIMEOUT=20
SIM_API_REQUEST_ID_HEADER=X-Request-ID
```

In Azure App Service, store the credential values as application settings or Key Vault references. Do not put SIM API credentials in a mobile or browser application.

Usage
-----

[](#usage)

```
use StellarSecurity\EsimLaravel\Client\SimApiClient;

final class EsimService
{
    public function __construct(
        private readonly SimApiClient $simApi,
    ) {}
}
```

### Plans, order and query

[](#plans-order-and-query)

```
$plans = $this->simApi->plans([
    'locationCode' => 'FR',
]);

// user_id is optional. Omitting it creates an anonymous eSIM.
$order = $this->simApi->order([
    'plan_id' => '1234 1234 1234 1234',
    'packageCode' => 'FR_10GB_30DAYS',
    'user_id' => 7345,
]);

$status = $this->simApi->query('1234 1234 1234 1234');
```

SIM IDs are normalized to an unspaced 16-digit value before transmission.

User ownership
--------------

[](#user-ownership)

These methods are intended for trusted server-side UI APIs. The UI API must first resolve the canonical Stellar user ID from the authenticated bearer token. A mobile app must never be allowed to choose a trusted `user_id` itself.

### List a user's eSIMs

[](#list-a-users-esims)

Project-style method:

```
$response = $this->simApi->user($userId);
```

Descriptive alias:

```
$response = $this->simApi->listUserSimcards($userId);
```

Calls:

```
POST /v1/sim/user

```

### Assign an existing SIM ID

[](#assign-an-existing-sim-id)

Project-style method:

```
$response = $this->simApi->patchUser(
    planId: '1234 1234 1234 1234',
    userId: $userId,
    source: 'mobile_app',
);
```

Descriptive alias:

```
$response = $this->simApi->assignSimcardToUser(
    planId: '1234 1234 1234 1234',
    userId: $userId,
);
```

Calls:

```
PATCH /v1/sim/user

```

Allowed source values:

```
purchase
manual_claim
account_migration
support
topup
mobile_app

```

The SIM API stores a keyed, versioned user reference rather than the raw user ID.

### Detach one eSIM

[](#detach-one-esim)

```
$response = $this->simApi->deleteUser(
    planId: '1234 1234 1234 1234',
    userId: $userId,
);

// Alias:
$response = $this->simApi->detachSimcardFromUser($planId, $userId);
```

Calls:

```
DELETE /v1/sim/user

```

### Detach all eSIMs for account deletion

[](#detach-all-esims-for-account-deletion)

```
$response = $this->simApi->deleteAllUser($userId);

// Alias:
$response = $this->simApi->detachAllSimcardsFromUser($userId);
```

Calls:

```
DELETE /v1/sim/user/all

```

Request IDs
-----------

[](#request-ids)

Every method accepts an optional final `$requestId` argument:

```
$response = $this->simApi->user(
    userId: $userId,
    requestId: $request->header('X-Request-ID'),
);
```

When omitted inside an HTTP request, the client automatically forwards the incoming configured request-ID header when present.

Validation
----------

[](#validation)

The client rejects invalid values before making a request:

- `user_id` must be greater than zero.
- `plan_id` must contain exactly 16 digits after spaces are removed.
- Ownership source must be one of the SIM API's supported values.

HTTP failures are raised through Laravel's normal `RequestException`. A non-JSON success response raises `UnexpectedValueException`.

Security boundary
-----------------

[](#security-boundary)

Correct architecture:

```
Mobile app
    -> authenticated Mobile UI API
    -> stellarsecurity/esim-laravel
    -> Stellar Simcard API

```

Do not install or configure this package inside a distributed client application. Its Basic Auth credentials are server secrets.

Testing
-------

[](#testing)

```
composer test
```

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance81

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~5 days

Total

2

Last Release

243d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/150491881?v=4)[Bob](/maintainers/stellar-security-os)[@stellar-security-os](https://github.com/stellar-security-os)

---

Top Contributors

[![bleko1234](https://avatars.githubusercontent.com/u/14978903?v=4)](https://github.com/bleko1234 "bleko1234 (3 commits)")[![stellar-security-os](https://avatars.githubusercontent.com/u/150491881?v=4)](https://github.com/stellar-security-os "stellar-security-os (1 commits)")

### Embed Badge

![Health badge](/badges/stellarsecurity-esim-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/stellarsecurity-esim-laravel/health.svg)](https://phpackages.com/packages/stellarsecurity-esim-laravel)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.5M7](/packages/exsyst-swagger)[lucasdotvin/laravel-soulbscription

A straightforward interface to handle subscriptions and features consumption.

709209.3k](/packages/lucasdotvin-laravel-soulbscription)[pimax/fb-messenger-php

Facebook Messenger Bot PHP API

313188.5k2](/packages/pimax-fb-messenger-php)

PHPackages © 2026

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