Download the PHP package andyfraussen/laravel-dokapi-client without Composer
On this page you can find all versions of the php package andyfraussen/laravel-dokapi-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download andyfraussen/laravel-dokapi-client
More information about andyfraussen/laravel-dokapi-client
Files in andyfraussen/laravel-dokapi-client
Package laravel-dokapi-client
Short Description A comprehensive, fluent Laravel client for the Dokapi Peppol API with full DTO support and OAuth2 integration
License MIT
Informations about the package laravel-dokapi-client
Laravel Dokapi Client
A sleek, fluent, and strongly-typed Laravel client for the Dokapi Peppol API. Built for modern PHP 8.3+ and Laravel 12/13 environments.
Introduction
Dokapi for Laravel provides a high-level, expressive interface for interacting with the Dokapi Peppol infrastructure. It abstracts away the complexities of OAuth2 authentication, token management, and raw API calls, allowing you to focus on building your application.
- Developer Experience First: A fluent, discoverable API that feels native to Laravel.
- Type Safety: Extensive use of DTOs ensures your IDE understands every response.
- Production Ready: Built-in OAuth2 caching, signature verification, and granular error handling.
- Future Proof: Fully optimized for PHP 8.3+ and Laravel 12/13.
Installation
You may install the package via Composer:
Next, you should publish the configuration file:
Configuration
After publishing the configuration, you may define your Dokapi credentials in your .env file:
The default DOKAPI_BASE_URL points to the staging environment defined in Dokapi's OpenAPI spec. Use the production base URL provided by Dokapi when you move to production.
If you already have an access token, set DOKAPI_ACCESS_TOKEN to bypass OAuth2.
For advanced HTTP tuning (proxies, custom headers, TLS options), you can pass Guzzle options via the dokapi.http config key.
Usage
The Fluent API
The recommended way to interact with Dokapi is through the fluent API provided by the Dokapi facade.
Outgoing Documents
You can easily send Peppol documents using our expressive request builders:
Error Handling
All non-2xx responses throw a DokapiRequestException subclass (auth, validation, not found, rate limit, server, or client errors). You can access the raw response body with getResponseBody() or a parsed ProblemDetail (when available) with getProblemDetail().
Participant registrations can also return a 207 response with a ProblemDetail payload. In that case, registerDto() returns a ProblemDetail instance instead of a success DTO.
Webhook Signature Verification
Security is paramount. Verify incoming webhooks with ease:
Testing
Static Analysis
We maintain a high standard of code quality using Larastan (PHPStan):
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-dokapi-client with dependencies
ext-json Version *
illuminate/support Version ^12.0|^13.0
illuminate/cache Version ^12.0|^13.0
guzzlehttp/guzzle Version ^7.8.2