PHP code example of vulturdev / cuentica
1. Go to this page and download the library: Download vulturdev/cuentica 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/ */
vulturdev / cuentica example snippets
'providers' => array(
//...
Vulturdev\Cuentica\CuenticaServiceProvider::class,
),
// Get the token from the .env file
$company = new Company;
// Use a variable
$company = new Company($token);
use Vulturdev\Cuentica\Models\Company;
$company = new Company;
print_r($company->company());
print_r($company->serie());
use Vulturdev\Cuentica\Models\Account;
$account = new Account;
print_r($account->accounts());
print_r($account->account(36528));
use Vulturdev\Cuentica\Models\Provider;
$provider = new Provider;
print_r($provider->providers());
print_r($provider->providers(array('q' => $search)));
print_r($provider->providers(array('page_size' => '5','page' => '2')));
print_r($this->createProvider());
print_r($provider->provider(377692));
private function createProvider() {
$provider = new Provider;
$newProvider = array(
'address' => 'Address',
'town' => 'Town',
'postal_code' => 'PostalCode',
'cif' => 'Cif',
'tradename' => 'Tradename',
'business_name' => 'Business Name',
'business_type' => 'company',
'region' => 'alicante',
);
print_r($provider->create($newProvider));
}
use Vulturdev\Cuentica\Models\Customer;
$customer = new Customer;
print_r($customer->customers());
print_r($customer->customers(array('q' => $search)));
print_r($customer->customers(array('page_size' => '5','page' => '2')));
print_r($customer->customer(322012));
print_r($customer->invoices(322012));
use Vulturdev\Cuentica\Models\Invoice;
$invoice = new Invoice;
print_r($invoice->invoices());
print_r($invoice->sendEmail(686665,array('to' => array($to),'reply_to' => $reply_to,'subject' => $subject,'body' => $body)));
$invoice->downloadPdf(686665);
use Vulturdev\Cuentica\Models\Expense;
$expense = new Expense;
print_r($expense->expenses());
print_r($expense->downloadAttachment(786351));