PHPackages                             tigamadou/emecef-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tigamadou/emecef-laravel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tigamadou/emecef-laravel
========================

Laravel adapter for the e-MECeF (Electronic Tax Invoice) SDK – Benin Republic

v0.0.2(2mo ago)01proprietaryPHPPHP &gt;=8.2

Since Feb 11Pushed 2mo agoCompare

[ Source](https://github.com/tigamadou/emecef-laravel)[ Packagist](https://packagist.org/packages/tigamadou/emecef-laravel)[ RSS](/packages/tigamadou-emecef-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (26)Versions (3)Used By (0)

emecef-laravel
==============

[](#emecef-laravel)

**Laravel adapter** for the Benin Republic **e-MECeF** (Electronic Tax Invoice) SDK. It wires [emecef-core-php](https://github.com/tigamadou/emecef/tree/main/php/packages/core/emecef-core-php) into Laravel via config, a facade, and Laravel’s HTTP and logging.

Part of the [e-MECeF SDK ecosystem](https://github.com/tigamadou/emecef).

Requirements
------------

[](#requirements)

- PHP ≥ 8.2
- Laravel 10.x or 11.x
- [emecef/emecef-core-php](https://github.com/tigamadou/emecef/tree/main/php/packages/core/emecef-core-php) ^1.0

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

[](#installation)

```
composer require tigamadou/emecef-laravel
```

The package auto-registers its service provider and the `Emecef` facade (Laravel 11+ package discovery). For older Laravel, add the provider and alias in `config/app.php` if needed.

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

[](#configuration)

1. Publish the config file:

    ```
    php artisan vendor:publish --tag=emecef-config
    ```
2. Store token, ifu, nim, and environment in the `emecef_config` table (see migrations). Config file is for Laravel-specific options only (e.g. `log_channel`).
3. Publish and run migrations to create invoice and config tables:

    ```
    php artisan vendor:publish --tag=emecef-migrations
    php artisan migrate
    ```

    Models: `Emecef\Laravel\Models\EmecefConfig`, `EmecefInvoice`, `EmecefInvoiceItem`, `EmecefInvoicePayment`
4. Optionally set `log_channel` for e-MECeF logs.
5. (Optional) Publish views to customize the web interface:

    ```
    php artisan vendor:publish --tag=emecef-views
    ```

    Views are copied to `resources/views/vendor/emecef`.

See **[docs/configuration.md](docs/configuration.md)** for the full config reference.

Web interface
-------------

[](#web-interface)

The package includes a web interface for all e-MECeF actions. After migrations and config, visit `/{prefix}/` (default: `/emecef/`):

RouteAction`GET /emecef/`Dashboard (API status, recent invoices)`GET /emecef/invoices`List invoices`GET /emecef/invoices/create`Create invoice form`GET /emecef/invoices/{id}`View invoice (confirm/cancel if pending)`GET /emecef/config`View configuration`GET /emecef/config/edit`Create or edit configuration (single row)Configure `route_prefix` and `route_middleware` in `config/emecef.php`. See [docs/configuration.md](docs/configuration.md).

Quick start
-----------

[](#quick-start)

Use the **facade** or inject **`Emecef\Core\Client`**:

```
use Emecef\Laravel\Facades\Emecef;

$status = Emecef::getStatusResponse();
```

```
use Emecef\Core\Client;

public function __construct(private readonly Client $emecef) {}
// $this->emecef->getStatusResponse(), submitInvoiceRequest(), confirmResponse(), cancelResponse(), etc.
```

All operations and DTOs are the same as in the core package. Example: submit an invoice and confirm:

```
use Emecef\Core\Dto\Request\InvoiceRequestDataDto;
use Emecef\Core\Dto\Request\ItemDto;
use Emecef\Core\Dto\Request\OperatorDto;
use Emecef\Core\Enum\InvoiceType;
use Emecef\Core\Enum\TaxGroupType;
use Emecef\Laravel\Facades\Emecef;

$request = new InvoiceRequestDataDto(
    ifu: '9999900000001',
    type: InvoiceType::FV,
    items: [
        new ItemDto('Article A', 1000, 2.0, TaxGroupType::A),
    ],
    operator: new OperatorDto('Opérateur 1')
);
$response = Emecef::submitInvoiceRequest($request);
if ($response->uid !== null) {
    $security = Emecef::confirmResponse($response->uid);
    // $security->qrCode, $security->codeMECeFDGI for the printed invoice
}
```

See **[docs/examples.md](docs/examples.md)** for more examples and error handling.

Documentation
-------------

[](#documentation)

DocumentDescription[Overview](docs/overview.md)What the package does and does not do, dependencies[Configuration](docs/configuration.md)Config file, routes, views, and how the client is built[Examples](docs/examples.md)Facade, dependency injection, web interface, submit/confirm/cancel, errors[Schema](docs/schema.md)Full database schema with API field mapping and descriptions[Core: DTOs and API](https://github.com/tigamadou/emecef/blob/main/php/packages/core/emecef-core-php/docs/dto-and-api.md)All enums, request/response DTOs, and API operationsWhat this package provides
--------------------------

[](#what-this-package-provides)

- **Config:** `config/emecef.php` with log channel, route prefix, and route middleware.
- **Bindings:** `HttpClientInterface` → Laravel HTTP client, `LoggerInterface` → Laravel Log (optional channel), `Client` as singleton.
- **Facade:** `Emecef\Laravel\Facades\Emecef` → `Emecef\Core\Client`.
- **Web interface:** Dashboard, invoice list/create/show, config management. Views are publishable (`emecef-views`).
- **Routes:** Prefixed by `route_prefix` (default `emecef`), protected by `route_middleware` (default `web`).

Business logic, DTOs, and API contract live in **emecef-core-php**; this adapter only integrates them with Laravel.

Development
-----------

[](#development)

```
composer install
composer phpcs
composer phpcbf
composer phpmd
composer test
composer phpstan
```

- Code style: PHP\_CodeSniffer (PSR-12).
- Mess detection: PHPMD.
- Tests: PHPUnit (Orchestra Testbench).
- Static analysis: PHPStan.

License
-------

[](#license)

Proprietary. See repository root for governance.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance87

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

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 ~25 days

Total

2

Last Release

66d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/acf4cf1df95ad685538cdf7e3eb4375aaa57ea4e25b3777401a62bfcd6ac873e?d=identicon)[tigamadou](/maintainers/tigamadou)

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tigamadou-emecef-laravel/health.svg)

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

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[yajra/laravel-datatables-oracle

jQuery DataTables API for Laravel

4.9k33.8M339](/packages/yajra-laravel-datatables-oracle)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[laravel/cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

264778.4k3](/packages/laravel-cashier-paddle)

PHPackages © 2026

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