Skip to content

Get Devices

Fetch the list of devices from your Traccar server.

WARNING

This operation can only be used by admins or managers to fetch all entities.

Request

Use the ThingsTelemetry\Traccar\Facades\Device::getAll() method to retrieve all devices.

php
use ThingsTelemetry\Traccar\Facades\Device;

$devices = Device::getAll(); // Illuminate\Support\Collection of DeviceData

Results

The response is a Illuminate\Support\Collection<int, ThingsTelemetry\Traccar\Dto\DeviceData>.

php
$first = $devices->first();

$name = $first->name;                 // "Truck 1"
$status = $first->status->label();    // "Online"
$category = $first->category->value;  // "truck"
$lastSeen = $first->lastUpdate?->toIso8601String();

// Attributes (typed)
$speedLimit = $first->attributes->speedLimit; // 80.0 (knots)

Key Result Items

Released under the MIT License.