Download the PHP package einvoicing/laravel without Composer

On this page you can find all versions of the php package einvoicing/laravel. 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

einvoicing/laravel

Peppol e-invoicing for Laravel: validate, convert and look up documents with the einvoicing.dev API.

It wraps einvoicing/sdk in the things a Laravel application already expects — a config file, a facade, a validation rule, Artisan commands, cached lookups and a testing fake — so nothing here needs a wrapper of your own.

Install

Requires PHP 8.4 and Laravel 13.

Pin the ruleset. Leave it out and validation follows whatever release is current, which means a change elsewhere can turn a passing build red without anything of yours changing.

Validating

An invalid document is a successful call. The report carries every finding, not only the first — the second one is usually the interesting one.

As a validation rule

Each error becomes its own message, naming the rule and quoting the fix. Warnings are ignored unless you ask for them: new PeppolDocument(warningsFail: true).

Converting your own data

Totals and the VAT breakdown are worked out from the lines, and the result is validated before it is returned. An invoice that cannot produce a valid document throws InvalidInvoiceException, whose findings() say why.

Looking a participant up

Lookups go through Laravel's cache — five minutes by default, matching the API's own caching. A participant who moves Access Point keeps their identifier, so re-check with Einvoicing::participant($id, fresh: true) when a send fails.

Two traps the SDK handles for you. A business absent from the optional Peppol Directory may still be registered and reachable, so directory being null means nothing on its own. And a UK VAT number is registered with or without its GB prefix, as two different participants; the lookup tries both and reports the form that answered. Store that form.

From the command line

einvoicing:validate exits non-zero on an invalid document, so it drops into CI as it stands.

Testing

Nothing leaves the machine once the fake is installed. Documents come back valid and participants come back registered unless you say otherwise, because the interesting tests are the ones where you say otherwise:

And the assertions:

The HTTP client

This package names no HTTP client. The SDK discovers the PSR-18 client and PSR-17 factories from whatever your application has installed, so there is nothing to configure.

Most Laravel apps already have Guzzle, since that is what the Http facade uses, and that is all discovery needs.

If yours does not, allow the discovery plugin and composer installs a pair for you — it asks on install, and saying yes is enough:

or install one yourself:

Decline the plugin and install nothing, and the install still succeeds — nothing checks at that point — but the first request throws NoHttpClientException.

To supply your own — an instrumented client, a proxy, a different timeout — replace the whole client rather than the pieces inside it:

One override point, and it is the object the facade actually uses. Binding ClientInterface on its own does nothing here — discovery is the mechanism, not the container.

Errors

Every failure is an Einvoicing\Exceptions\EinvoicingException: UnauthenticatedException, AllowanceExhaustedException, RateLimitedException (with retryAfter()), NotFoundException, InvalidInvoiceException (with findings()), ProblemException and TransportException. Branch on $e->type or $e->slug(), never on the title or the detail — those are prose for a human reading a log.

Development

Licence

MIT.


All versions of laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
einvoicing/sdk Version ^0.2
illuminate/console Version ^13.0
illuminate/contracts Version ^13.0
illuminate/support Version ^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 einvoicing/laravel contains the following files

Loading the files please wait ...