承接 andyfraussen/laravel-dokapi-client 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

andyfraussen/laravel-dokapi-client

Composer 安装命令:

composer require andyfraussen/laravel-dokapi-client

包简介

A comprehensive, fluent Laravel client for the Dokapi Peppol API with full DTO support and OAuth2 integration

README 文档

README

Latest Version on Packagist Total Downloads License

A sleek, fluent, and strongly-typed Laravel client for the Dokapi Peppol API. Built for modern PHP 8.3+ and Laravel 11/12 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 11/12.

Installation

You may install the package via Composer:

composer require andyfraussen/laravel-dokapi-client

Next, you should publish the configuration file:

php artisan vendor:publish --provider="AndyFraussen\Dokapi\DokapiServiceProvider" --tag="dokapi-config"

Configuration

After publishing the configuration, you may define your Dokapi credentials in your .env file:

DOKAPI_CLIENT_ID=your-client-id
DOKAPI_CLIENT_SECRET=your-client-secret
DOKAPI_BASE_URL=https://peppol-api.dokapi-stg.io/v1
DOKAPI_TOKEN_URL=https://dev-portal.dokapi.io/api/oauth2/token
DOKAPI_ACCESS_TOKEN=
DOKAPI_TIMEOUT=30
DOKAPI_CONNECT_TIMEOUT=10
DOKAPI_VERIFY=true
DOKAPI_USER_AGENT=andyfraussen/laravel-dokapi-client

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.

use AndyFraussen\Dokapi\Facades\Dokapi;

// Send a document with a single call
$response = Dokapi::api()->outgoingDocuments->sendDto($payload, $xml);

echo $response->document->ulid;

Outgoing Documents

You can easily send Peppol documents using our expressive request builders:

use AndyFraussen\Dokapi\Dto\ParticipantIdentifier;
use AndyFraussen\Dokapi\Requests\OutgoingDocumentRequest;

$request = new OutgoingDocumentRequest(
    sender: ParticipantIdentifier::of('0208:0123456789'),
    receiver: ParticipantIdentifier::of('0208:9876543210'),
    c1CountryCode: 'BE',
    documentTypeIdentifier: $docType,
    processIdentifier: $process,
    externalReference: 'inv-2026-001'
);

$response = Dokapi::sendOutgoingDocument($request, $xml);

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:

use AndyFraussen\Dokapi\Facades\Dokapi;

$isValid = Dokapi::webhooks()->verifySignature(
    payload: $request->getContent(),
    signature: $request->header('X-Dokapi-Signature'),
    secret: config('dokapi.webhook_secret')
);

Testing

composer test

Static Analysis

We maintain a high standard of code quality using Larastan (PHPStan):

composer phpstan

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.

andyfraussen/laravel-dokapi-client 适用场景与选型建议

andyfraussen/laravel-dokapi-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 26 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 andyfraussen/laravel-dokapi-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 andyfraussen/laravel-dokapi-client 我们能提供哪些服务?
定制开发 / 二次开发

基于 andyfraussen/laravel-dokapi-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 33
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-26