PHP code example of lvdhoorn / laravel-wefact

1. Go to this page and download the library: Download lvdhoorn/laravel-wefact 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/ */

    

lvdhoorn / laravel-wefact example snippets


// config/wefact.php
'panels' => [

    'default' => [
        'url' => env('HOSTFACT_DEFAULT_URL'),
        'key' => env('HOSTFACT_DEFAULT_KEY'),
    ],

    'ppe' => [
        'url' => env('HOSTFACT_PPE_URL'),
        'key' => env('HOSTFACT_PPE_KEY'),
    ],

],

// DebtorsController
public function getIndex()
{
    $debtors = Wefact::panel('ppe')->debtors()->all([
        'Sort' => 'DebtorCode',
        'limit' => 20
    ]);

    //
}

// Route
Route::get('/wefact/{hostFact}/debtors', ['as' => 'wefact/debtors', 'uses' => 'DebtorsController@getIndex']);

Route::bind('hostFact', function ($value, $route) {
    app('Wefact')->panel($value);

    return app('Wefact');
});

// DebtorsController
public function getIndex(Wefact $hostFact)
{
    $debtors = $hostFact->debtors()->all([
        'Sort' => 'DebtorCode',
        'limit' => 20
    ]);

    //
}

Wefact::attachments()->add(array $params)
Wefact::attachments()->delete(array $params)
Wefact::attachments()->download(array $params)

Wefact::creditinvoices()->add(array $params)
Wefact::creditinvoices()->delete(array $params)
Wefact::creditinvoices()->edit(array $params)
Wefact::creditinvoices()->list(array $params)
Wefact::creditinvoices()->markAsPaid(array $params)
Wefact::creditinvoices()->partPayment(array $params)
Wefact::creditinvoices()->show(array $params)

Wefact::creditors()->add(array $params)
Wefact::creditors()->delete(array $params)
Wefact::creditors()->edit(array $params)
Wefact::creditors()->list(array $params)
Wefact::creditors()->show(array $params)

Wefact::debtors()->add(array $params)
Wefact::debtors()->checkLogin(array $params)
Wefact::debtors()->edit(array $params)
Wefact::debtors()->generatePdf(array $params)
Wefact::debtors()->list(array $params)
Wefact::debtors()->sendEmail(array $params)
Wefact::debtors()->show(array $params)
Wefact::debtors()->updateLoginCredentials(array $params)

Wefact::groups()->add(array $params)
Wefact::groups()->delete(array $params)
Wefact::groups()->edit(array $params)
Wefact::groups()->list(array $params)
Wefact::groups()->show(array $params)

Wefact::invoices()->add(array $params)
Wefact::invoices()->block(array $params)
Wefact::invoices()->cancelSchedule(array $params)
Wefact::invoices()->credit(array $params)
Wefact::invoices()->delete(array $params)
Wefact::invoices()->download(array $params)
Wefact::invoices()->edit(array $params)
Wefact::invoices()->list(array $params)
Wefact::invoices()->markAsPaid(array $params)
Wefact::invoices()->markAsUnpaid(array $params)
Wefact::invoices()->partPayment(array $params)
Wefact::invoices()->paymentProcessPause(array $params)
Wefact::invoices()->paymentProcessReactivate(array $params)
Wefact::invoices()->schedule(array $params)
Wefact::invoices()->sendByEmail(array $params)
Wefact::invoices()->sendReminderByEmail(array $params)
Wefact::invoices()->sendSummationByEmail(array $params)
Wefact::invoices()->show(array $params)
Wefact::invoices()->unblock(array $params)

Wefact::pricequotes()->accept(array $params)
Wefact::pricequotes()->add(array $params)
Wefact::pricequotes()->decline(array $params)
Wefact::pricequotes()->delete(array $params)
Wefact::pricequotes()->download(array $params)
Wefact::pricequotes()->edit(array $params)
Wefact::pricequotes()->list(array $params)
Wefact::pricequotes()->sendByEmail(array $params)
Wefact::pricequotes()->show(array $params)

Wefact::products()->add(array $params)
Wefact::products()->delete(array $params)
Wefact::products()->edit(array $params)
Wefact::products()->list(array $params)
Wefact::products()->show(array $params)

php artisan vendor:publish --provider="Invato\Wefact\ServiceProvider" --tag="config"