PHPackages                             philharmonie/lexware-office-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. [API Development](/categories/api)
4. /
5. philharmonie/lexware-office-laravel

ActiveLibrary[API Development](/categories/api)

philharmonie/lexware-office-laravel
===================================

Lexware Office API integration for Laravel

v1.5.1(7mo ago)2531MITPHPPHP ^8.2CI passing

Since Jan 9Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/philharmonie/lexware-office-laravel)[ Packagist](https://packagist.org/packages/philharmonie/lexware-office-laravel)[ Fund](https://www.paypal.com/paypalme/pharmonie)[ GitHub Sponsors](https://github.com/philharmonie)[ RSS](/packages/philharmonie-lexware-office-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (12)Versions (13)Used By (0)

Lexware Office Laravel Package
==============================

[](#lexware-office-laravel-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6a13fefc146786806fd6040cb7130d5b67be9e8a75978c3a921b731d9389722b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068696c6861726d6f6e69652f6c6578776172652d6f66666963652d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/philharmonie/lexware-office-laravel)[![Total Downloads](https://camo.githubusercontent.com/d80c377f0de5b4a7c137d62d974695a6fc93d9192f191f3e4b322d20736eb06f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068696c6861726d6f6e69652f6c6578776172652d6f66666963652d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/philharmonie/lexware-office-laravel)[![License](https://camo.githubusercontent.com/b2a402879b09d965252c46d31abb04b5f4148331298d0968543fd9a968f186a9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7068696c6861726d6f6e69652f6c6578776172652d6f66666963652d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/philharmonie/lexware-office-laravel)

A Laravel package for seamless integration with the Lexware Office API. This package provides an elegant way to interact with Lexware Office services, including contacts and invoices management.

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

[](#requirements)

- PHP ^8.2
- Laravel ^10.0|^11.0
- Guzzle ^7.0

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

[](#installation)

You can install the package via composer:

```
composer require philharmonie/lexware-office-laravel
```

### Service Provider

[](#service-provider)

The service provider is automatically registered using Laravel's auto-discovery feature. If you need to register it manually, add the following line to the providers array in `config/app.php`:

```
PhilHarmonie\LexOffice\ServiceProvider::class,
```

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

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag="lexoffice-config"
```

Add your Lexware Office API key to your `.env` file:

```
LEXOFFICE_API_KEY=your-api-key
LEXOFFICE_BASE_URL=https://api.lexware.io/v1
LEXOFFICE_TIMEOUT=30
LEXOFFICE_RETRY_ATTEMPTS=3
LEXOFFICE_CACHE_TTL=300
LEXOFFICE_RATE_LIMITING_ENABLED=true
LEXOFFICE_LOGGING_ENABLED=false
```

### Configuration Options

[](#configuration-options)

- `LEXOFFICE_API_KEY` - Your Lexware Office API key (required)
- `LEXOFFICE_BASE_URL` - API base URL (default: )
- `LEXOFFICE_TIMEOUT` - Request timeout in seconds (default: 30)
- `LEXOFFICE_RETRY_ATTEMPTS` - Number of retry attempts for failed requests (default: 3)
- `LEXOFFICE_CACHE_TTL` - Cache time-to-live in seconds (default: 300)
- `LEXOFFICE_RATE_LIMITING_ENABLED` - Enable automatic rate limiting (default: true)
- `LEXOFFICE_LOGGING_ENABLED` - Enable detailed API logging (default: false)

Usage
-----

[](#usage)

### Contacts

[](#contacts)

```
use PhilHarmonie\LexOffice\Facades\Contact;

// Find a contact by ID
$contact = Contact::find('contact-id');

// List contacts with optional filters
$contacts = Contact::list(['email' => 'example@domain.com']);
```

### Invoices

[](#invoices)

```
use PhilHarmonie\LexOffice\Facades\Invoice;

// Create an invoice
$invoice = Invoice::create($data, $finalize = false);

// Find an invoice by ID
$invoice = Invoice::find('invoice-id');
```

### Dunning

[](#dunning)

```
use PhilHarmonie\LexOffice\Facades\Dunning;

// Create a dunning
$dunning = Dunning::create($data);

// Find a dunning
$dunning = Dunning::find('dunning-id');

// Pursue a dunning
$result = Dunning::pursue('dunning-id');

// Render dunning document
$document = Dunning::render('dunning-id');

// Download dunning file
$file = Dunning::download('dunning-id');

// Get deeplink
$link = Dunning::deeplink('dunning-id');
```

### Using Builders

[](#using-builders)

The package provides fluent builders for creating invoices and related structures with comprehensive validation:

```
use PhilHarmonie\LexOffice\Builders\InvoiceBuilder;
use PhilHarmonie\LexOffice\Builders\AddressBuilder;
use PhilHarmonie\LexOffice\Builders\LineItemBuilder;

$invoice = InvoiceBuilder::make()
    ->timezone('Europe/Berlin')
    ->voucherDate(now())
    ->address(
        AddressBuilder::make()
            ->name('Company Name')
            ->supplement('c/o John Doe')
            ->street('Street 123')
            ->city('City')
            ->zip('12345')
            ->countryCode('DE')
    )
    ->addLineItem(
        LineItemBuilder::custom()
            ->name('Product')
            ->description('Detailed description of the product')
            ->quantity(1)
            ->unitName('piece')
            ->unitPrice('EUR', 99.99, 19.0)
    )
    ->addLineItem(
        LineItemBuilder::text()
            ->name('Note')
            ->description('Additional context for the invoice')
    )
    ->taxConditions('net')
    ->paymentConditions(
        label: '10 days - 3%',
        duration: 30,
        discountPercentage: 3.0,
        discountRange: 10
    )
    ->shippingConditions(
        date: now()->addDays(5),
        type: 'delivery'
    )
    ->title('Invoice')
    ->introduction('Introduction text for the invoice')
    ->remark('Thank you for your business!')
    ->toArray(); // Automatically validates the invoice data
```

### Error Handling

[](#error-handling)

The package provides enhanced error handling with detailed exception information:

```
use PhilHarmonie\LexOffice\Exceptions\ApiException;

try {
    $invoice = Invoice::create($data);
} catch (ApiException $e) {
    echo "Status Code: " . $e->getStatusCode();
    echo "Response: " . json_encode($e->getResponse());
    echo "Message: " . $e->getMessage();
}
```

### Advanced Usage

[](#advanced-usage)

For advanced use cases, you can inject services directly:

```
use PhilHarmonie\LexOffice\Services\ContactService;
use PhilHarmonie\LexOffice\Services\InvoiceService;

class MyController
{
    public function __construct(
        private ContactService $contactService,
        private InvoiceService $invoiceService
    ) {}

    public function createInvoice()
    {
        $contact = $this->contactService->find('contact-id');
        $invoice = $this->invoiceService->create($data);
    }
}
```

### Performance Features

[](#performance-features)

The package includes several performance optimizations:

- **Automatic Caching**: GET requests to read-only endpoints are automatically cached
- **Rate Limiting**: Automatic throttling to stay within API limits (2 requests/second)
- **Retry Logic**: Automatic retry with exponential backoff for 5xx errors and rate limits

Testing
-------

[](#testing)

```
composer test
```

This will run:

- Code style checks (Pint)
- Static analysis (PHPStan)
- Unit tests (Pest)
- Refactoring checks (Rector)

Individual test commands:

```
composer test:lint    # Run Laravel Pint
composer test:types   # Run PHPStan
composer test:unit    # Run Pest tests
composer test:refacto # Run Rector
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Phil Harmonie](https://github.com/philharmonie)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance62

Regular maintenance activity

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

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

Every ~23 days

Recently: every ~0 days

Total

12

Last Release

237d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/49812f3fd6f17e6c988107697eac9df6d436ab9d751ab0e8c31cba6dd9cc4f7b?d=identicon)[philharmonie](/maintainers/philharmonie)

---

Top Contributors

[![philharmonie](https://avatars.githubusercontent.com/u/5270589?v=4)](https://github.com/philharmonie "philharmonie (28 commits)")[![pkpg](https://avatars.githubusercontent.com/u/148192601?v=4)](https://github.com/pkpg "pkpg (4 commits)")

---

Tags

apilaravelpackageofficelexware

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/philharmonie-lexware-office-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/philharmonie-lexware-office-laravel/health.svg)](https://phpackages.com/packages/philharmonie-lexware-office-laravel)
```

###  Alternatives

[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[bmatovu/laravel-mtn-momo

Laravel MTN MOMO integration.

14310.9k](/packages/bmatovu-laravel-mtn-momo)[joggapp/laravel-aws-sns

Laravel package for the SNS events by AWS

3171.8k](/packages/joggapp-laravel-aws-sns)[vinelab/api-manager

Laravel API Manager Package - beatify and unify your responses with the least effort possible.

392.1k](/packages/vinelab-api-manager)

PHPackages © 2026

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