Skip to content

Group Share Data Dto Reference

The ThingsTelemetry\Traccar\Dto\GroupShareData represents the result of sharing a group of devices. It includes the generated token, the expiration time, the group ID, and a computed share URL that can be opened in the Traccar web UI.

php
use Carbon\CarbonImmutable;
use ThingsTelemetry\Traccar\Facades\Share;

$share = Share::group(groupId: 2, expiration: CarbonImmutable::now()->addHours(12));

Properties

PropertyTypeDescription
groupIdintIdentifier of the shared group.
tokenstringShare token string returned by the server.
expirationCarbonImmutableToken expiration time as a Carbon instance.
urlstringComputed share URL for the Traccar UI.

groupIdinteger

Identifier of the shared group.

php
$share->groupId; // 2

tokenstring

Share token string returned by the server.

php
$share->token; // "eyJhbGciOi..."

expirationCarbonImmutable

Token expiration time as a Carbon instance.

php
$share->expiration->toIso8601String(); // "2030-12-31T23:59:59+00:00"

urlstring

Computed share URL for the Traccar UI (base URL derived from config and token appended as query string).

php
$share->url; // "https://demo.traccar.org/?token=eyJhbGciOi..."

Released under the MIT License.