Download the PHP package neamatrix/connex without Composer
On this page you can find all versions of the php package neamatrix/connex. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download neamatrix/connex
More information about neamatrix/connex
Files in neamatrix/connex
Package connex
Short Description Laravel package for Connex DCB login: protected-script, OTP via login-connex, confirm via login-confirm, customizable login UI, mobile Sanctum tokens.
License MIT
Homepage https://github.com/NeaMatrix/connex-package
Informations about the package connex
neamatrix/connex
Laravel package for Connex DCB login: server-side auth-login + protected-script, browser-only dcbprotect / gateway-load, server-side login-connex + login-confirm-connex, customizable login UI, mobile Sanctum tokens.
Database (users table)
Package migrations add Connex subscriber fields from OTP confirm success:
| Column | Example | Source |
|---|---|---|
msisdn |
218920920110 |
success.msisdn |
subscriber |
exist |
success.subscriber |
status |
active |
success.status |
operator |
Libyana |
success.operator |
expiration_date |
2032-08-11 15:56:54 |
success.expiration_date |
Migrations live in packages/torgodly/connex/database/migrations/ (auto-loaded by the package).
Ensure your User model includes these in $fillable (and expiration_date cast as datetime).
Tests
From the Laravel app root:
Covers URL building, upstream HTTP (faked), user sync, OTP confirm API, Sanctum token issuance, and the login page.
Requirements
- PHP 8.2+
- Laravel 10, 11, 12, or 13
- laravel/sanctum (recommended for mobile API tokens after OTP confirm)
Install
From Packagist (after package is submitted)
Submit https://github.com/NeaMatrix/connex-package on Packagist.org, then:
Before Packagist / dev install
If you see "Could not find a version matching minimum-stability (stable)", use the GitHub repo directly:
Or allow dev stability once:
Local path (development)
Environment
Upstream endpoints
Each call uses CONNEX_BASE_URL + CONNEX_*_ENDPOINT.
| Purpose | Env | Default |
|---|---|---|
| Auth token | CONNEX_AUTH_LOGIN_ENDPOINT |
/auth-login |
| DCB script | CONNEX_PROTECTED_SCRIPT_ENDPOINT |
/protected-script |
| Send OTP | CONNEX_LOGIN_CONNEX_ENDPOINT |
/login-connex |
| Confirm OTP | CONNEX_LOGIN_CONFIRM_ENDPOINT |
/login-confirm-connex |
Browser vs server (v1.1+)
| Step | Where it runs |
|---|---|
auth-login, protected-script, login-connex |
Laravel (POST /connex/api/bootstrap, POST /connex/api/request-otp) |
dcbprotect script + DCBProtectRun + gateway-load |
Browser (antifraud; credentials never sent to the client) |
login-confirm-connex |
Laravel (POST /connex/api/confirm-otp) |
ConnexLoginConfig exposes only Laravel API URLs + CSRF + selectors — not CONNEX_AUTH_EMAIL, CONNEX_AUTH_PASSWORD, or upstream URLs.
Default login page
Package registers GET {CONNEX_WEB_LOGIN_PATH} (default /connex/login) → connex::login.
Custom login page (design in your Blade view)
All layout and CSS live in your view — not in config/connex.php. The package only requires correct element IDs (from connex.selectors) and the submit button outside the hidden phone/OTP step wrappers.
Publish the example and edit it:
Copy resources/views/vendor/connex/login.blade.php to e.g. resources/views/my-login.blade.php, change classes/markup freely, then:
Minimal custom page:
data-connex-hidden-classon<x-connex-login>must match the class you use to hide steps (e.g. Tailwindhidden, Bootstrapd-none, or your ownis-hidden).- Button
data-connex-enabled-class/data-connex-disabled-classare optional; JS swaps them when enabling/disabling the button.
Without the component — same markup, end with:
Wrap markup in <div data-connex-login-root data-connex-hidden-class="hidden"> so step toggling works.
Required elements (configurable via config/connex.php → selectors):
| Purpose | Default id / name |
|---|---|
| MSISDN input | #msisdn |
| Submit button | #cta_button — must stay outside hidden phone/otp step wrappers (default layout does this) |
| Transaction | #transaction_identify |
| Device type | name="device_type" value web |
OTP + mobile login
- Page load →
POST /connex/api/bootstrap(freshtransaction_identify+dcbprotect). - User submits phone →
POST /connex/api/request-otp(server callslogin-connex; OTP sent). - UI automatically switches to the OTP field (
#otpin#connex_otp_step; button label becomes “Verify OTP”). - User submits OTP →
POST /connex/api/confirm-otp(Laravel):- Calls upstream
login-confirm-connexwithmsisdn+otp+device_type - Creates/updates local user from Connex
successpayload - Issues Sanctum token for the mobile app
- Runs your
HandlesOtpConfirmationhandler for custom JSON
- Calls upstream
Custom OTP handling
Implement Torgodly\Connex\Contracts\HandlesOtpConfirmation and bind it:
Mobile API response (POST /connex/api/confirm-otp)
Mobile app: store auth.token, send Authorization: Bearer {token} on API calls.
Web hook
Changelog
v1.1.2
- UI: design only in Blade views —
<x-connex-login>is a thin wrapper; removedconnex.ui.classesconfig and styled partials.
v1.1.1
- Fix: OTP confirm updates existing users matched by
msisdnor{msisdn}@connex.localemail (no duplicate email error).
v1.1.0
- Security: upstream auth, protected-script, and login-connex run on the server; browser only runs
dcbprotect/gateway-load. - New API routes:
POST {CONNEX_API_PREFIX}/bootstrap,POST …/request-otp. - Default confirm upstream path:
/login-confirm-connex(CONNEX_LOGIN_CONFIRM_ENDPOINT).
v1.0.2
- Send
device_typeon login-confirm upstream request.
v1.0.1
- Fix: Sign In button visible on OTP step.
v1.0.0
- Initial release.
All versions of connex with dependencies
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/routing Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/view Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0