PHP code example of gyvex-com / maakeenfactuur-laravel

1. Go to this page and download the library: Download gyvex-com/maakeenfactuur-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gyvex-com / maakeenfactuur-laravel example snippets


use Gyvex\MaakEenFactuur\Facades\Customer;

// Fetch all customers
$customers = Customer::all();

// Create a new customer
$newCustomer = Customer::create(['name' => 'John Doe', 'email' => '[email protected]']);

// Find a specific customer
$customer = Customer::find(1);

use Gyvex\MaakEenFactuur\Facades\Invoice;

// Create an invoice
$newInvoice = Invoice::create(['customer_id' => 1, 'amount' => 100.00]);

// Update an existing invoice
$updatedInvoice = Invoice::update(1, ['amount' => 150.00]);

// Fetch all invoices
$invoices = Invoice::all();

// Find a specific invoice
$invoice = Invoice::find(1);

try {
    $invoice = Invoice::find(1);
} catch (Gyvex\MaakEenFactuur\Exception\ApiErrorException $e) {
    // Handle error
    echo 'Error: ' . $e->getMessage();
}
bash
php artisan vendor:publish --tag="maakeenfactuur-config"