Search by

tes / biotime-sdk

thomas-emad

Framework-agnostic PHP SDK for the ZKTeco BioTime device API — token auth, attendance, employees, devices, departments, positions, areas, and resignations.

v1.1.0 2026-08-27 12:29 UTC

This package is auto-updated.

Last update: 2026-08-27 12:34:01 UTC


README

A modern, framework-agnostic PHP SDK for the ZKTeco BioTime device REST API — token auth, attendance, employees, devices, departments, positions, areas, and resignations.

PHP Version License: MIT Packagist

📖 Full documentation: thomas-emad.github.io/biotime-sdk

What it does

BioTime SDK wraps token authentication, automatic re-authentication on 401, pagination, and typed DTO mapping around the BioTime REST API, so you write:

$biotime = new BioTime();

$employee = $biotime->employees()->find('EMP001');

echo $employee->firstName;

instead of hand-rolling HTTP calls, token headers, and manual retries.

Install

composer require tes/biotime-sdk

Requires PHP ^8.1. In Laravel apps, the service provider is auto-discovered — nothing else to register. See Laravel installation.

Quick start

use BioTime\BioTime;

$biotime = new BioTime(); // reads BIOTIME_* env vars, or config/biotime.php

// Attendance for a date range, every page, as typed DTOs
$records = $biotime->attendances()->all('2026-07-01', '2026-07-31');

foreach ($records as $record) {
    echo "{$record->empCode} punched {$record->punchState} at {$record->punchTime}\n";
}

// Employees
$employee = $biotime->employees()->find('EMP001');

// Devices, departments, positions, areas
$devices     = $biotime->devices()->all();
$departments = $biotime->departments()->all();

Full walkthrough: Getting Started → Quick Start.

Supported resources

Resource Docs
Attendances thomas-emad.github.io/biotime-sdk/resources/attendances
Employees thomas-emad.github.io/biotime-sdk/resources/employees
Devices thomas-emad.github.io/biotime-sdk/resources/devices
Departments thomas-emad.github.io/biotime-sdk/resources/departments
Positions thomas-emad.github.io/biotime-sdk/resources/positions
Areas thomas-emad.github.io/biotime-sdk/resources/areas
Resignations thomas-emad.github.io/biotime-sdk/resources/resignations

Documentation

This README is intentionally short. The full documentation site covers configuration, authentication, pagination, filtering, DTOs, error handling, Laravel integration, advanced usage, a complete API reference, real-world examples, and troubleshooting:

👉 thomas-emad.github.io/biotime-sdk

Links

Contributing

Issues and pull requests are welcome — see Contributing for the full workflow (fork, branch, composer install, composer test, PR).

License

The MIT License (MIT). See LICENSE for details.