amaizing-company / certifaction-client-laravel
Certifaction api client package.
Fund package maintenance!
amaizing-company
Requires
- php: ^8.4
- illuminate/contracts: ^11.0||^12.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^10.0.0||^9.0.0||^8.22.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- spatie/laravel-ray: ^1.35
README
The certifaction client for laravel provides ability to communicate with certifactions signature api.
Installation
You can install the package via composer:
composer require amaizing-company/certifaction-client-laravel
You can publish and run the migrations with:
php artisan vendor:publish --tag="certifaction-client-laravel-migrations"
php artisan migrate
You should publish the config file with:
php artisan vendor:publish --tag="certifaction-client-laravel-config"
This is the contents of the published config file:
return [ /* * API * * Set environment endpoints and credentials to initiate communication with certifaction api servers. * To avoid security risks, this configuration should only be defined via the environment variables. */ 'api' => [ 'environments' => [ CertifactionEnvironment::LOCAL->value => env('CERTIFACTION_LOCAL_URI'), CertifactionEnvironment::ADMIN->value => env('CERTIFACTION_ADMIN_URI'), ], 'auth' => [ 'key' => env('CERTIFACTION_CLIENT_API_KEY'), ], ], /* * DATABASE * * Defines the behavior of database migrations. */ 'database' => [ 'table_prefix' => 'certifaction_', ], /* * The default jurisdiction that used to create requests. */ 'jurisdiction' => Jurisdiction::EIDAS, /* * The default role ID for new users. */ 'role_id' => '', /* * Determines if certifaction should store a digital twin of documents in there cloud. This can be overwritten from config * of a signable document and is used when no other config provided. */ 'digital_twin' => false, /* * Determines if documents are in general in pdf-a format. This can be overwritten from config * of a signable document and is used when no other config provided. */ 'pdf_a' => false, /* * Determines if certifaction should notify the signer about a new request. This can be overwritten from config * of a signable document and is used when no other config provided. */ 'notify_signer' => false, /* * The default webhook url that is called when a signature request finished. This can be overwritten from config * of a signable document and is used when no other config provided. */ 'webhook_url' => '', /* * STORAGE * * The storage config allows to define where signed and downloaded documents should be stored. This config can be * overwritten inside the model configuration of a signable document model that uses the certifaction documents * concern. */ 'storage_disk' => 'local', 'storage_directory' => 'certifaction/documents', /* * BROADCASTING * * If broadcasting is expected for events set this option true. */ 'broadcasting' => false, /* * Enable default package routes. */ 'default_routes' => true, ];
Certifaction Client
This package needs certifactions api client server to communicate with certifactions cloud services. Please follow the guide from certifactions documentation, to get started with the local api client.
Basic Configuration
To get started you should generate an api key from certifactions web application. Please follow the steps of certifactions local api documentation.
You may set the following environment variables to get started. Please replace the default values.
CERTIFACTION_LOCAL_URI=https://[DOMAIN/IP]:[PORT] # The uri where your local certifaction client is reachable CERTIFACTION_ADMIN_URI=https://api.certifaction.io # The uri where certifactions admin api is reachable CERTIFACTION_CLIENT_API_KEY=*********** # Your API Key
Now your application should be able to reach the local certifaction client. You could test this by calling the following artisan command.
php artisan certifaction:server:ping
For more detailed information you could also call:
php artisan certifaction:server:health
When everything is working fine, you should set a default role_id with that new accounts will create. To do that, set
the role_id
config value inside the published package configuration file. You can get an overview over the roles inside your certifaction instance with the
following command:
php artisan certifaction:roles:list
Thats it. For more detailed configuration options just have a look inside the docs.
Usage
Please view the docs.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.