coding-libs/zkteco-php

A package for managing ZKTeco device.

v0.0.27 2024-09-04 07:54 UTC

README

Zkteco Logo

Warning

⚠️ This repository is not recommended for use in production. ⚠️

This repository is currently in development and may contain bugs or incomplete features. Use at your own risk and do not deploy to a production environment.

About zkteco-php

The zkteco-php library provides a robust solution for php/laravel developers to interface with ZK BioMetric Fingerprint Attendance Devices. Its user-friendly API allows seamless extraction of data, such as registered users, logs, and device versions. Developers can also add users, retrieve real-time logs, and clear attendance records. Using a socket connection, the library ensures fast and reliable data exchange. Whether creating an attendance system or a time-and-attendance management application, zkteco-js is the essential tool for integrating biometric devices efficiently.

Installation

composer require coding-libs/zkteco-php

Usage Example

// Uncomment the line below if you are not using a PHP framework and need to manually load Composer dependencies.
// require_once "vendor/autoload.php";

use CodingLibs\ZktecoPhp\Libs\ZKTeco;
$zktecoLib = new Zkteco('192.168.1.1');
$zkteco->connect();

$zktecoLib->vendorName(); // "ZKTeco Inc.
$zktecoLib->deviceName(); // "F22/ID
$zktecoLib->serialNumber(); // "BOCK201261276
$zktecoLib->pinWidth(); // "14
$zktecoLib->faceFunctionOn(); // "0
$zktecoLib->platform(); // "ZLM60_TFT
$zktecoLib->fmVersion(); // "10
$zktecoLib->ssr(); // "1
$zktecoLib->version(); // "Ver 6.60 Sep 19 2019
$zktecoLib->workCode(); // "0
$zktecoLib->getFingerprint(1); 
$zktecoLib->getUsers(); // users
$zktecoLib->getAttendances(); // attendances logs
$zktecoLib->getTime(); // device time
$zktecoLib->clearAdminPriv(); // Removes the admin privileges from the current user.
$zktecoLib->clearAllUsers(); // clear all users
$zktecoLib->deleteUsers(function($user){
   // condition goes there
}); // delete users conditionally

Contributing

Please see CONTRIBUTING for details.

Security

If you've found a bug regarding security please mail codinglibs4u@gmail.com instead of using the issue tracker.

Alternatives

License

The MIT License (MIT). Please see License File for more information.