Alfa Sign
Description
Laravel Enso backend integration package for Alfa Sign remote electronic signing services. Exposes SOAP-based actions for sending files and computing document hashes, with centralized settings management and encrypted authentication token storage.
Installation
This package is consumed as a private Composer path repository within the Enso application:
{
"repositories": [
{
"type": "path",
"url": "vendor/laravel-enso/alfasign"
}
],
"require": {
"laravel-enso/alfa-sign": "*@dev"
}
}
After adding it, run:
composer update laravel-enso/alfa-sign
php artisan migrate
Features
- SOAP integration with the Alfa Sign remote signing service via
laravel-enso/apiAction,SoapEndpoint, andSoapResponse SendFileoperation — sends a document to Alfa Sign for signing and returns a newFilemodel with the signed PDFSendHashoperation — computes a SHA-256 hash of a document and submits it to Alfa Sign for signingSettingsmodel with encryptedauth_token(viaLaravelEnso\Helpers\Casts\Encrypt) and configurable WSDLurlandenabledflag- Dynamic service enablement — operations check
Settings::enabled()at runtime and skip gracefully when disabled - CRUD endpoints for managing integration settings from the Enso admin UI
- Enso-compatible migration for the
alfasign_settingstable, menu structure ("Integrations → Alfasign → Settings"), and permissions
Usage
Sending a file for signing
use LaravelEnso\AlfaSign\Services\SendFile;
use LaravelEnso\Files\Models\File;
$signedFile = (new SendFile(File::find($id)))->handle();
Returns a new File instance containing the signed PDF returned by Alfa Sign.
Computing and submitting a document hash
use LaravelEnso\AlfaSign\Services\SendHash;
use LaravelEnso\Files\Models\File;
$hash = (new SendHash(File::find($id)))->handle();
Returns the SHA-256 hash string used in the signing request.
Settings management
Settings are managed through the admin UI at Integrations → AlfaSign → Settings. Programmatic access:
use LaravelEnso\AlfaSign\Models\Settings;
$settings = Settings::current(); // retrieves or creates the singleton record
$settings->enabled; // bool
$settings->auth_token; // decrypted automatically
$settings->url; // Alfa Sign WSDL endpoint URL
The url setting is passed directly to PHP's SoapClient as the WSDL location. For ASMX services, use the service description endpoint, not the browser service page:
https://ca.alfasign.ro/PilotSignTestPrdgm/RemoteSignature.asmx?WSDL
Using the base .asmx URL without ?WSDL may return an HTML service page, which SoapClient cannot parse as WSDL.
Configuration
After publishing:
php artisan vendor:publish --tag=alfa-sign-config
Config file: config/enso/alfa-sign.php
return [
'settingsId' => env('ALFASIGN_SETTINGS_ID', 1),
];
API
Services
| Class | Description |
|---|---|
LaravelEnso\AlfaSign\Services\SendFile | Sends a File model to Alfa Sign and returns the signed File |
LaravelEnso\AlfaSign\Services\SendHash | Computes a SHA-256 hash of a File and submits it |
Actions
| Class | Description |
|---|---|
LaravelEnso\AlfaSign\Actions\SendFile | Extends LaravelEnso\Api\Action and handles the SOAP request/response lifecycle for file signing |
LaravelEnso\AlfaSign\Actions\SendHash | Extends LaravelEnso\Api\Action and handles the SOAP request/response lifecycle for hash signing |
SOAP endpoints
| Class | Description |
|---|---|
LaravelEnso\AlfaSign\Endpoints\SendFile | Extends LaravelEnso\Api\Endpoints\Soap, calls RemotePdfSignature, and exposes a sanitized log payload |
LaravelEnso\AlfaSign\Endpoints\SendHash | Extends LaravelEnso\Api\Endpoints\Soap, calls RemoteSignatureHash, and exposes a sanitized log payload |
Note
The SOAP endpoints pass the authentication token and file contents through arguments() for the actual Alfa Sign call, but keep body() sanitized so API logs and failure notifications do not expose sensitive values.
Models
| Class | Description |
|---|---|
LaravelEnso\AlfaSign\Models\Settings | Singleton settings model. Stores url, auth_token (encrypted), enabled |
HTTP Endpoints
| Method | URI | Route name | Description |
|---|---|---|---|
| GET | api/integrations/alfaSign/settings | integrations.alfaSign.settings.index | Returns the settings form payload |
| PATCH | api/integrations/alfaSign/settings/{settings} | integrations.alfaSign.settings.update | Updates the settings record |
Companion Frontend Package
@enso-ui/alfa-sign— Vue 3 settings page
Depends On
laravel-enso/api— SOAP action, endpoint, response, and logging infrastructurelaravel-enso/forms— Enso form servicelaravel-enso/helpers—Encryptcast,FactoryResolverlaravel-enso/files—Filemodel
Contributions
are welcome. Pull requests are great, but issues are good too. Thank you to all the people who already contributed to Enso!
License
Proprietary. See LICENSE.