PHP code example of drei-d / laravel-jtl-api

1. Go to this page and download the library: Download drei-d/laravel-jtl-api 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/ */

    

drei-d / laravel-jtl-api example snippets


$tokenDto = app(\DREID\LaravelJtlApi\Helpers\AppRegistrationHelper::class)->register();

$repository = app(\DREID\LaravelJtlApi\Modules\Company\CompanyRepository::class);
$response = $repository->queryCompanies();

dump($response->companies);

$repository = app(\DREID\LaravelJtlApi\Modules\Customer\CustomerRepository::class);

$response = $repository->queryCustomers(
    new \DREID\LaravelJtlApi\Modules\Customer\Requests\QueryCustomersRequest(
        searchKeyWord: 'Mustermann',
        pageSize: 100
    )
);

dump($response->items);
shell
php artisan vendor:publish --provider DREID\\LaravelJtlApi\\Providers\\ServiceProvider

DREID\LaravelJtlApi\Modules\AppRegistration\DataTransferObjects\TokenDto^ {#843
  +apiKey: "0b1ee12b-2cf8-4fd5-9920-b104789621f0"
} // app/Console/Commands/RegisterAppCommand.php:31