Download the PHP package beziworld/laravel-edoreczenia without Composer

On this page you can find all versions of the php package beziworld/laravel-edoreczenia. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-edoreczenia

Laravel e-Doręczenia

tests Latest Version

Laravel client for e-Doręczenia, the Polish registered electronic delivery service (KSDE). Connect a mailbox (skrzynka do doręczeń elektronicznych) of your company or institution to a Laravel application as an external system, the same way EZD document management systems do:

Polska wersja dokumentacji

Why this package

The only other PHP package on Packagist, b44x/edoreczenia, is a framework-agnostic PSR-18 SDK. This package is built for Laravel: the HTTP client (Http::fake() works in your tests), the cache for tokens and cursors, a manager with named and runtime connections, events and a scheduler-ready poller, a notification channel, a facade with full @method annotations and configuration through .env.

Before you start

e-Doręczenia has no public sandbox. You need:

  1. An electronic delivery address (ADE) of the entity, for example AE:PL-12345-67890-ABCDE-12.
  2. The external system added to the mailbox in the permission module (Moduł uprawnień) by the mailbox administrator: generate an RSA key pair and a CSR, the administrator uploads the CSR and gives the system a name. In the production environment non-public entities need a commercially obtained qualified certificate; one certificate serves one system.
  3. For the integration environment (INT): an application to the Ministry of Digital Affairs ([email protected], forms on gov.pl), with the public IP addresses of your servers. INT is reachable only from whitelisted addresses.

The host clock must be synchronised (NTP): the authorisation server checks iat, nbf and exp of the assertion.

Installation

The package signs {"iss": "<ADE>.SYSTEM.<name>", "sub": same, "aud": "<realm URL>", "iat", "nbf", "exp", "jti"} with RS256 and posts it to the token endpoint with ?login_hint=ADE.<ADE>. The 5-minute access token is cached and reused until shortly before it expires.

INT PROD
Token endpoint int-ow.edoreczenia.gov.pl/auth/realms/EDOR ow.edoreczenia.gov.pl/auth/realms/EDOR
UA API (mailbox) uaapi-int-ow.poczta-polska.pl/api/v3 uaapi-ow.poczta-polska.pl/api/v3
SE API (address search) int-ow.edoreczenia.gov.pl/api/se/v4 ow.edoreczenia.gov.pl/api/se/v4

Every endpoint can be overridden (EDORECZENIA_TOKEN_URL, EDORECZENIA_AUDIENCE, EDORECZENIA_UA_URL, EDORECZENIA_SE_URL).

Sending messages

Replies keep the thread: OutgoingMessage::replyTo($message)->text('...'). Up to 15 recipients are sent in the standard mode; 16 to 1000 recipients use the mass mode, which requires exactly one attachment of at most 15 MB. Attachment names may have up to 128 characters, without spaces and ~"#%&*:<>?!/\{|}, with a lower-case extension. The text body has at most 5000 characters. A violation throws InvalidMessage before anything is sent.

Hybrid messages (printed and delivered by post): ->toPostalAddress(new PostalAddress(...)), ->fromAddress(...) and ->hybrid([...HybridShipment options...]); only PDF attachments are accepted.

Drafts: createDraft(), updateDraft(), addDraftAttachment() (Base64), uploadDraftAttachment() (multipart, for large files), deleteDraftAttachment(), sendDraft(), drafts(), draft(), deleteDrafts().

Receiving messages

Reading is a legal act. There is no separate "mark as read" call: the mailbox sets opened when a message is read in the Full or FullExtended format. Reading a notice of arrival also transfers the message from the delivery service and issues evidence E.1 (delivery). markAsRead() therefore reads the messages in the Full format. Use MessageFormat::Metadata to inspect messages without opening them. When the transfer of a notice takes longer than a few seconds, the API answers HTTP 202 and the client throws MessagePending: repeat the request later.

Evidences

The proofs of sending and receipt (BP.WX/BP.WP and BP.OX/BP.OP) replace the "UPD/UPN" confirmations known from ePUAP.

Address search (BAE)

The SE API is not public: it uses the token of the mailbox and the mailbox address as the sender. "No address found" (SEAPI-00010) returns an empty result. search()->search([...]) accepts the raw BaeSearch structure.

Polling and events

The poller lists the inbox newest first (metadata, so nothing is opened) and walks back to the stored cursor; the evidences of the mailbox have their own cursor. Events are dispatched oldest first, at least once: make listeners idempotent. On the first run EDORECZENIA_POLL_INITIAL=all dispatches what is already in the inbox (up to max_pages x page_size), now only remembers it. Options: --messages, --evidences, --reset, a connection name. MailboxPoller::setCursor() skips history.

Push notifications are available when the application is reachable from the internet: EDoreczenia::subscribe(['messageCallbackUrl' => ..., 'evidenceCallbackUrl' => ...]), subscriptions(), toggleSubscription(), unsubscribe(). The callback answers HTTP 200 with {"notification": "on"}.

Notifications

Notification::route('edoreczenia', 'AE:PL-...') works for on-demand notifications; ->connection('second') on the message selects another mailbox. The channel returns the SendResult.

Many mailboxes

Other operations

Threads, folders, rules, archive tasks and other UA API operations are available through the generic call:

{address} is replaced with the mailbox address. Only GET requests are retried.

Errors

Exception When
InvalidConfiguration missing or malformed address, system name, key, environment or algorithm; unknown connection
AuthenticationException the token endpoint rejected the assertion (error(): invalid_client, ...) or is unreachable
ApiException UA or SE API error: httpStatus(), errorCode() (UA error or SEAPI-000xx), errors(), retryAfter(), isRetryable()
MessagePending HTTP 202: the message of a notice is still being transferred; repeat later
InvalidMessage a documented rule is violated before sending (recipients, attachments, text, more than 50 ids)
CouldNotSendNotification the notification has no toEDoreczenia() or returns something else

All extend EDoreczeniaException. Read calls are retried on connection errors and HTTP 5xx; sending, deleting and changing are never retried. A 401 drops the cached token and repeats the call once with a new token.

Scope and limits

Implemented from the published contracts: UA API 3.0.8 (uaapi_3.0.8.2.yaml), SE API 4.0.5 and the integration guides for INT and PROD of the Ministry of Digital Affairs and the Central IT Centre (COI). Points not covered by the public documentation:

Development

Tests use Http::fake() with payloads built from the official OpenAPI contracts; no request leaves the test suite.

Author

Created and maintained by Kamil Ćwiertnia, beziworld.eu.

Need an integration? Get in touch through beziworld.eu.

Other packages by the author

laravel-ksef · laravel-krs · laravel-ceidg · laravel-company-data

License

MIT. See LICENSE.md. e-Doręczenia is a service of the Polish Ministry of Digital Affairs (Ministerstwo Cyfryzacji) operated with Poczta Polska as the designated operator. This package is not affiliated with or endorsed by the Ministry of Digital Affairs, the Central IT Centre (COI) or Poczta Polska.


All versions of laravel-edoreczenia with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-json Version *
ext-openssl Version *
guzzlehttp/guzzle Version ^7.8
illuminate/cache Version ^12.0|^13.0
illuminate/console Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
illuminate/events Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/notifications Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package beziworld/laravel-edoreczenia contains the following files

Loading the files please wait ...