PHP code example of dvlasearch / sdk

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

    

dvlasearch / sdk example snippets




use DVLASearch\SDK\Clients\Vehicle;

$client = new Vehicle('API KEY HERE');
$vehicle = $client->get('MT09 VCA');

// $vehicle->error will be set if the number plate isn't attached to a vehicle
if(!isset($vehicle->error)) {
  var_dump($vehicle);
} else {
  var_dump('No vehicle found for ' . $vehicle->plate);
}

$vehicle->mot();

$vehicle->tyres();



use DVLASearch\SDK\Clients\Mot;

$client = new Mot('API KEY HERE');
$mot = $client->get('MT09 VCA');

// $vehicle->error will be set if the number plate isn't attached to a vehicle
if(!isset($mot->error)) {
  var_dump($mot);
} else {
  var_dump('No MOT found for ' . $mot->plate);
}

$vehicle->vehicle();

$vehicle->tyres();



use DVLASearch\SDK\Clients\Tyres;

$client = new Tyres('API KEY HERE');
$tyres = $client->get('MT09 VCA');

// $vehicle->error will be set if the number plate isn't attached to a vehicle
if(!isset($tyres->error)) {
  var_dump($tyres);
} else {
  var_dump('No MOT found for ' . $tyres->plate);
}

$tyres->vehicle();

$tyres->mot();