PHPackages                             bee-coded/laravel-efactura - 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. [Payment Processing](/categories/payments)
4. /
5. bee-coded/laravel-efactura

ActiveLibrary[Payment Processing](/categories/payments)

bee-coded/laravel-efactura
==========================

Laravel wrapper for e-Factura SDK with token storage, job scheduling, and easy model integration

v2.3.0(2w ago)281Apache-2.0PHPPHP ^8.4

Since Feb 5Pushed 3mo agoCompare

[ Source](https://github.com/BEE-CODED/laravel-efactura)[ Packagist](https://packagist.org/packages/bee-coded/laravel-efactura)[ RSS](/packages/bee-coded-laravel-efactura/feed)WikiDiscussions main Synced today

READMEChangelog (7)Dependencies (27)Versions (19)Used By (0)

Laravel e-Factura
=================

[](#laravel-e-factura)

A Laravel package that wraps [bee-coded/laravel-efactura-sdk](https://packagist.org/packages/bee-coded/laravel-efactura-sdk) to provide token storage, job scheduling, and easy model integration for Romanian e-Factura (ANAF SPV) compliance.

Features
--------

[](#features)

- **Token Management** - OAuth token storage per CUI with automatic refresh
- **Background Jobs** - Ready-to-use jobs for invoice uploads, status checks, and message syncing
- **Model Integration** - Simple interface + trait pattern for your invoice models
- **Event-Driven** - Events for all key operations (uploads, failures, received invoices)
- **Minimal Setup** - Auto-discovery, publishable config and migrations

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

[](#requirements)

- PHP 8.4+
- Laravel 11.x or 12.x
- ANAF SPV OAuth credentials

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

[](#installation)

```
composer require bee-coded/laravel-efactura
```

Publish the configuration and migrations:

```
php artisan vendor:publish --tag=efactura-config
php artisan vendor:publish --tag=efactura-migrations
php artisan migrate
```

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

[](#configuration)

### Environment Variables

[](#environment-variables)

```
# SDK Configuration (required)
EFACTURA_SANDBOX=true
EFACTURA_CLIENT_ID=your-anaf-client-id
EFACTURA_CLIENT_SECRET=your-anaf-client-secret
EFACTURA_REDIRECT_URI=https://your-app.com/efactura/callback

# Package Configuration
EFACTURA_ENABLED=true
EFACTURA_UPLOAD_ENABLED=true
EFACTURA_DOWNLOAD_RECEIVED=false
EFACTURA_SYNC_MESSAGES=true

# Storage
EFACTURA_STORAGE_DISK=local
EFACTURA_STORAGE_PATH=efactura

# Queue (null = default queue)
EFACTURA_QUEUE=null

# Rate Limit Handling
EFACTURA_RATE_LIMIT_RETRY_HOURS=24
EFACTURA_RATE_LIMIT_RETRY_BATCH=250
EFACTURA_RATE_LIMIT_RETRY_MAX_DAYS=7

# Routes
EFACTURA_ROUTES_ENABLED=true
EFACTURA_ROUTES_PREFIX=efactura
EFACTURA_SUCCESS_REDIRECT=/
EFACTURA_ERROR_REDIRECT=/
```

### Config File

[](#config-file)

The configuration file (`config/efactura.php`) allows you to:

- Enable/disable the entire package or specific features
- Configure file storage for XML and ZIP files
- Set job schedules using cron expressions
- Customize OAuth callback routes

Model Integration
-----------------

[](#model-integration)

### 1. Implement the Interface

[](#1-implement-the-interface)

Your invoice model must implement `EFacturaUploadableInterface`:

```
