PHP code example of justbetter / laravel-dynamics-client
1. Go to this page and download the library: Download justbetter/laravel-dynamics-client 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/ */
justbetter / laravel-dynamics-client example snippets
use JustBetter\DynamicsClient\Client\Dynamics;
use JustBetter\DynamicsClient\Data\Entity;
use JustBetter\DynamicsClient\Query\QueryBuilder;
$dynamics = app(Dynamics::class);
$customers = $dynamics->entities('customers', QueryBuilder::make()
->where('city', 'Alkmaar')
->orderBy('displayName')
->get());
$customer = $customers->first();
$customer->displayName = 'John Doe';
$dynamics->entity($customer)->update();
$dynamics = app(Dynamics::class);
$dynamics
->tenantId('::tenant-id::')
->environment('Production')
->api('justbetter/general/v1.0')
->companyId('::company-id::');
// Any other placeholder, or several at once.
$dynamics->set('environment', 'Sandbox');
$dynamics->parameters(['environment' => 'Sandbox', 'api' => 'v2.0']);
$dynamics->reset();