Download the PHP package pristavu/laravel-anaf without Composer
On this page you can find all versions of the php package pristavu/laravel-anaf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pristavu/laravel-anaf
More information about pristavu/laravel-anaf
Files in pristavu/laravel-anaf
Package laravel-anaf
Short Description Laravel package for interacting with ANAF web services
License MIT
Homepage https://github.com/pristavu/laravel-anaf
Informations about the package laravel-anaf
laravel-anaf
This package makes it easy to work with ANAF services in Laravel applications.
Installation
You can install the package via composer:
You can publish and run the migrations with:
You can publish the config file with:
What you can do with this package
- OAuth2 - authentication/authorization.
- get authorization url
- retrieve access token
- refresh access token
- eFactura - client/connector (Oauth2 token required) for interacting with the eFactura API.
- retrieve messages/invoices (regular and paginated)
- download invoices as zip
- extract invoice xml, signature and invoice dto from zip
- validate xml invoices
- upload xml invoices (B2B, B2C)
- convert xml invoices to PDF
- check message status
- taxPayer - client/connector (public API / No need for Oauth2) for interacting with the taxpayer API.
- vat status check and other taxpayer information (by cif)
- balance sheet retrieval (by year)
Usage
You can use the package via the Anaf facade:
or via helper function:
OAuth2 usage
Add the following to your .env file:
or update config/anaf.php with your environment variables
Redirect to authorization server
Token retrieval on auth callback
Refreshing existing access token
Efactura usage (Oauth2 required)
Initializing the client
Switching to test mode (sandbox)
Debugging Request & Response
Caching
- For certain operations like downloading invoices, cache is enabled by default to avoid hitting ANAF download limit rate (10 downloads/day for same $downloadId).
Retrieving messages/invoices
- You need to use paginated messages if you expect more than 500 messages/invoices for specified period.
Retrieving paginated messages/invoices
- Somehow even if the paginated response should provide 500 messages per page and total messages are less than 500, messages are divided into two pages (eg: total 95 messages are returned as 2 pages, first with 49 and second with 46 messages).
Downloading messages/invoices
Validating messages/invoices
Uploading an invoice
Converting invoice to PDF
Message status
TaxPayer usage
Initializing the client
Checking VAT status
Retrieving balance sheet
Testing
Using the fake client
You can use the mock client to simulate API responses during testing in your laravel application.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Andrei Pristavu
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-anaf with dependencies
ext-dom Version *
ext-libxml Version *
ext-simplexml Version *
ext-zip Version *
illuminate/cache Version ^11.0||^12.0||^13.0
illuminate/contracts Version ^11.0||^12.0||^13.0
illuminate/support Version ^11.0||^12.0||^13.0
josemmo/einvoicing Version ^0.3.1
saloonphp/cache-plugin Version ^3.0
saloonphp/saloon Version ^4.0
spatie/laravel-package-tools Version ^1.92.7