PHP code example of thingstelemetry / laravel-traccar

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

    

thingstelemetry / laravel-traccar example snippets


use ThingsTelemetry\Traccar\Facades\Server;

// returns ThingsTelemetry\Traccar\Dto\ServerData
$info = Server::get(); 

$version = $info->version; // '6.10'
$speedUnit = $info->attributes->speedUnit->value; // 'kn', 'kmh', or 'mph'
$timezone = $info->attributes->timezone; // e.g. 'UTC'
bash
php artisan vendor:publish --tag=config --provider="ThingsTelemetry\Traccar\TraccarServiceProvider"