Device Data DTO Reference
The ThingsTelemetry\Traccar\Dto\DeviceData represents a Traccar device entity with typed fields and sensible defaults. It is used for both reading devices and constructing payloads (e.g., for creating a device).
use ThingsTelemetry\Traccar\Facades\Device;
$devices = Device::getAll(); // Illuminate\Support\Collection<DeviceData>
$device = $devices->first();Creating a new DTO for create operations
use ThingsTelemetry\Traccar\Dto\DeviceData;
use ThingsTelemetry\Traccar\Dto\DeviceAttributesData;
use ThingsTelemetry\Traccar\Enums\DeviceCategory;
use ThingsTelemetry\Traccar\Enums\DeviceStatus;
$dto = new DeviceData(
name: 'My Vehicle',
uniqueId: '8346436046093', // IMEI or serial recommended
attributes: new DeviceAttributesData(speedLimit: 80),
);id → integer|null
Traccar device identifier. Null until the device is created by the server.
$device->id; // 2551name → string
Human-friendly device name.
$device->name; // "Company Truck 12"uniqueId → string
Unique device identifier. IMEI, serial number or other id. It has to match the identifier device reports to the server.
$device->uniqueId; // "3567395245678901"IMPORTANT
The uniqueId must be unique across all devices in the Traccar instance. Traccar uses the uniqueId to match incoming positions with the device they belong to.
attributes → DeviceAttributesData
Typed device attribute bag. See the dedicated reference.
$attrs = $device->attributes; // instance of DeviceAttributesData
$attrs->toArray(); // array<string, mixed>status → DeviceStatus (default: UNKNOWN)
Device connection status.
$device->status->value; // "online"
$device->status->label(); // "Online"disabled → boolean (default: false)
Whether the device is disabled in Traccar.
$device->disabled; // falselastUpdate → CarbonImmutable|null (ISO 8601 parsed)
Timestamp of the device’s last update. Parsed to CarbonImmutable when present; null if missing or unparsable.
$device->lastUpdate?->toIso8601String(); // "2019-08-24T14:15:22Z"positionId → integer|null
Latest known position record ID for this device.
$device->positionId; // 987654groupId → integer|null
Group identifier if the device belongs to a Traccar group.
$device->groupId; // 42phone → string|null
Associated SIM or contact phone number.
$device->phone; // "+1234567890"model → string|null
Device model or tracker model identifier.
$device->model; // "TK103"contact → string|null
Optional contact person or label for the device.
$device->contact; // "John Doe"category → DeviceCategory (default: DEFAULT)
Device category/classification.
$device->category->value; // "car"
$device->category->label(); // "Car"