zoparga / easybill
Laravel Package to use the easybill.de REST API
Installs: 22
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:package
Requires
- guzzlehttp/guzzle: ^6.2|^7.0
- illuminate/contracts: ^8.73
- illuminate/support: ~5.5.0|~5.6.0|~5.7.0|~5.8.0|^6.0|^7.0|^8.0
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- nunomaduro/collision: ^5.10
- orchestra/testbench: ^6.22
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
README
Unofficial Laravel Package to use the easybill.de REST API.
This Laravel Package is a very basic and untested version!
Installation
composer require zoparga/easybill
Laravel 5.5+
No need to register any providers / aliases. Thanks to Laravels Package Discovery.
Laravel 5.4
Add the ServiceProvider and Facade in config/app.php
'providers' => [ ... zoparga\EasyBill\EasybillServiceProvider::class, ]; 'aliases' => [ ... 'EasyBill' => zoparga\EasyBill\Facade\EasyBill::class, ];
Configuration
Add your easybill.de api key to your .env
EASYBILL_API_KEY=xxxxxx
Usage
I only implemented some basic api calls
// Search Customer with exact match EasyBill::searchCustomer([ 'company_name' => 'Company Name' ]); // Create Customer $customer = EasyBill::createCustomer([ 'company_name' => 'Musterfirma GmbH', 'first_name' => 'Max', 'last_name' => 'Muster', 'street' => 'Musterstr. 123', 'zipcode' => '12345', 'city' => 'Musterstadt', 'emails' => ['mail@example.com'], ]); // Delete Customer EasyBill::deleteCustomer($customer->id); // Create Document (Invoice) $doc = EasyBill::createDocument([ 'type' => 'INVOICE', 'title' => 'Titel', //'customer_id' => 0, 'text_prefix' => 'Hello', 'text' => 'Bye', 'items' => [ [ 'type' => 'POSITION', 'number' => '123', // article number 'description' => 'Positionsbeschreibung 1', 'quantity' => 1, 'single_price_net' => 10 * 100, // cent 'vat_percent' => 19 ], [ 'type' => 'TEXT', 'description' => 'Text only', ], [ 'type' => 'POSITION', 'description' => 'Positionsbeschreibung 3', 'quantity' => 1, 'single_price_net' => 20 * 100, 'vat_percent' => 19 ], ], ]); // Finish Document (set auto created document number) $doc->done(); $pdf = EasyBill::getPDF($pdfID); $resultPdf = $pdf->getBody(); // Update Document EasyBill::updateDocument($id, ['status' => 'DONE']);
Contributing
If you find an issue, or have a better way to do something, feel free to open an issue or a pull request.