PHPackages                             mozhuilungdsuo/laravel-cdac-e-hastakshar - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. mozhuilungdsuo/laravel-cdac-e-hastakshar

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

mozhuilungdsuo/laravel-cdac-e-hastakshar
========================================

Laravel package for CDAC e-Hastakshar PDF request and response handling.

1.0.0(yesterday)03↑2900%MITPHPPHP ^8.2

Since Jun 9Pushed todayCompare

[ Source](https://github.com/mozhuilungdsuo/laravel-cdac-e-hastakshar)[ Packagist](https://packagist.org/packages/mozhuilungdsuo/laravel-cdac-e-hastakshar)[ RSS](/packages/mozhuilungdsuo-laravel-cdac-e-hastakshar/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (11)Versions (2)Used By (0)

Laravel CDAC e-Hastakshar
=========================

[](#laravel-cdac-e-hastakshar)

Laravel package for preparing CDAC e-Hastakshar PDF requests, signing request XML, handling eSign responses, and storing signed PDFs.

This package intentionally does not register routes, controllers, or views. Host applications should implement their own user flow and call the package service.

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

[](#installation)

From Packagist:

```
composer require mozhuilungdsuo/laravel-cdac-e-hastakshar
php artisan vendor:publish --tag=cdac-e-hastakshar-config
```

### Install Requirements

[](#install-requirements)

This package requires the PHP Imagick extension because uploaded PDFs/images are converted to page images before the signature placeholder is prepared. Composer will fail with `requires ext-imagick * but it is not present` until the extension is installed for the same PHP binary used by Composer.

On macOS with Homebrew:

```
brew install imagemagick
pecl install imagick
php --ini
php -m | grep -i imagick
```

On Ubuntu/Debian:

```
sudo apt-get update
sudo apt-get install php-imagick
sudo systemctl restart apache2
# or, for PHP-FPM:
sudo systemctl restart php*-fpm
php -m | grep -i imagick
```

If you use a versioned PHP package on Ubuntu/Debian, install the matching extension package:

```
sudo apt-get install php8.3-imagick
# replace 8.3 with your PHP version
```

On RHEL/CentOS/Fedora:

```
sudo dnf install php-pecl-imagick
sudo systemctl restart httpd
php -m | grep -i imagick
```

Confirm PHP can see the extension:

```
php -v
composer -vvv about
php -m | grep imagick
```

Keys
----

[](#keys)

Private keys and certificates are intentionally not shipped with the package. Add them to the root folder of the app, commonly:

```
keys/
  eSign_Staging_Private.key
```

Configure the path:

```
ESIGN_PRIVATE_KEY=keys/eSign_Staging_Private.key
ESIGN_PRIVATE_KEY_PASSPHRASE=
```

Usage
-----

[](#usage)

Inject `Mozhuilungdsuo\LaravelCdacEHastakshar\Services\EsignService` in your own controller.

```
use Illuminate\Http\Request;
use Mozhuilungdsuo\LaravelCdacEHastakshar\Services\EsignService;
use RuntimeException;

class EsignController
{
    public function index()
    {
        return view('esign.index');
    }

    public function store(Request $request, EsignService $esign)
    {
        $validated = $request->validate([
            'document' => ['required', 'file', 'mimes:pdf,jpg,jpeg,png', 'max:20480'],
            'signer_name' => ['nullable', 'string', 'max:120'],
        ]);
        $signerName = $validated['signer_name'] ?? $request->user()?->name;

        $payload = $esign->createRequest($validated['document'], $signerName);

        return view('esign.redirect', $payload);
    }

    public function response(Request $request, EsignService $esign)
    {
        $responseXml = (string) $request->input('eSignResponse', '');

        if ($responseXml === '') {
            return view('esign.result', [
                'status' => 'failed',
                'message' => 'The eSign response was empty.',
            ]);
        }

        try {
            $result = $esign->completeResponse($responseXml);
        } catch (RuntimeException $exception) {
            return view('esign.result', [
                'status' => 'failed',
                'message' => $exception->getMessage(),
            ]);
        }

        return view('esign.result', [
            'status' => 'completed',
            'transactionId' => $result['transaction_id'],
            'downloadUrl' => route('esign.download', $result['transaction_id']),
        ]);
    }

    public function download(string $transactionId, EsignService $esign)
    {
        return $esign->signedDownloadResponse($transactionId);
    }
}
```

Create `resources/views/esign/index.blade.php` in the host app for the upload form:

```

        {{ __('eSign document') }}

            {{ __('eSign document') }}
            {{ __('Upload a PDF or image to prepare it for CDAC e-Hastakshar.') }}

                @csrf

                    {{ __('Signer name') }}

                @error('signer_name')
                    {{ $message }}
                @enderror

                    {{ __('Document') }}

                @error('document')
                    {{ $message }}
                @enderror

                    {{ __('Start eSign') }}

```

Create `resources/views/esign/redirect.blade.php` in the host app to submit the generated request to CDAC:

```

        {{ __('Redirecting to eSign') }}

                {{ __('Continue to eSign') }}

            document.getElementById('esign-request-form').submit();

```

Create `resources/views/esign/result.blade.php` in the host app for success/failure responses:

```

        {{ __('eSign result') }}

            @if ($status === 'completed')
                {{ __('eSign completed') }}
                {{ __('The signed PDF has been saved and is ready to download.') }}
                {{ __('Transaction') }}: {{ $transactionId }}
                {{ __('Download') }}
            @else
                {{ __('eSign failed') }}
                {{ $message }}
            @endif

```

Example host-app routes:

```
use App\Http\Controllers\EsignController;
use Illuminate\Support\Facades\Route;

Route::get('esign', [EsignController::class, 'index'])->name('esign.index');
Route::post('esign', [EsignController::class, 'store'])->name('esign.store');
Route::post('esign/response', [EsignController::class, 'response'])->name('esign.response');
Route::get('esign/{transactionId}/download', [EsignController::class, 'download'])->name('esign.download');
```

For Laravel's application bootstrap middleware configuration, exclude the callback route from CSRF validation:

```
$middleware->validateCsrfTokens(except: [
    'esign/response',
]);
```

Dependencies
------------

[](#dependencies)

The package declares its runtime dependencies in `composer.json`, including:

- `robrichards/xmlseclibs`
- `tecnickcom/tc-lib-pdf`
- `tecnickcom/tc-font-mirror`
- `ext-imagick`

Composer will install those dependencies when this package is installed.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance100

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

1d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6372fbb59453de0c379e7e99663f75a624f87ae7136dbe57e857452d8e30fc8b?d=identicon)[mozhui](/maintainers/mozhui)

---

Top Contributors

[![mozhuilungdsuo](https://avatars.githubusercontent.com/u/33083654?v=4)](https://github.com/mozhuilungdsuo "mozhuilungdsuo (9 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/mozhuilungdsuo-laravel-cdac-e-hastakshar/health.svg)

```
[![Health](https://phpackages.com/badges/mozhuilungdsuo-laravel-cdac-e-hastakshar/health.svg)](https://phpackages.com/packages/mozhuilungdsuo-laravel-cdac-e-hastakshar)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

76318.2M110](/packages/laravel-mcp)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9732.3M121](/packages/roots-acorn)[laravel/ai

The official AI SDK for Laravel.

9782.1M153](/packages/laravel-ai)[moonshine/moonshine

Laravel administration panel

1.3k239.9k72](/packages/moonshine-moonshine)[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.

45344.0k1](/packages/pressbooks-pressbooks)

PHPackages © 2026

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