百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
Z

zkteco

> 编程语言
开源

ZKTeco Laravel 库

191 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

ZKTeco Laravel 库

ZKTeco - Laravel Library

The rats/zkteco package provides easy to use functions to ZKTeco Device activities.

Requires: Laravel >= 6.0

License: MIT or later

Installation:

You can install the package via composer:

bash
composer require rats/zkteco

The package will automatically register itself.

You have to enable your php socket if it is not enable.

Usage

  1. Create a object of ZKTeco class.
php
    use Rats\Zkteco\Lib\ZKTeco;

//  1 s't parameter is string $ip Device IP Address
//  2 nd  parameter is integer $port Default: 4370
  
    $zk = new ZKTeco('192.168.1.201');
    
//  or you can use with port
//    $zk = new ZKTeco('192.168.1.201', 8080);
    
  1. Call ZKTeco methods
  • Connect
php
//    connect
//    this return bool
    $zk->connect();   
  • Disconnect
php
//    disconnect
//    this return bool

    $zk->disconnect();   
  • Enable Device
php
//    enable
//    this return bool/mixed

    $zk->enableDevice();   

NOTE: You have to call after read/write any info of Device.

  • Disable Device
php
//    disable 
//    this return bool/mixed

    $zk->disableDevice(); 

NOTE: You have to call before read/write any info of Device.

  • Device Version
php
//    get device version 
//    this return bool/mixed

    $zk->version(); 
  • Device Os Version
php
//    get device os version 
//    this return bool/mixed

    $zk->osVersion(); 
  • Power Off
php
//    turn off the device 
//    this return bool/mixed

    $zk->shutdown(); 
  • Restart
php
//    restart the device 
//    this return bool/mixed

    $zk->restart(); 
  • Sleep
php
//    sleep the device 
//    this return bool/mixed

    $zk->sleep(); 
  • Resume
php
//    resume the device from sleep 
//    this return bool/mixed

    $zk->resume(); 
  • Voice Test
php
//    voice test of the device "Thank you" 
//    this return bool/mixed

    $zk->testVoice(); 
  • Platform
php
//    get platform 
//    this return bool/mixed

    $zk->platform(); 
  • Firmware Version
php
//    get firmware version
//    this return bool/mixed

    $zk->fmVersion(); 
  • Work Code
php
//    get work code
//    this return bool/mixed

    $zk->workCode(); 
  • SSR
php
//    get SSR
//    this return bool/mixed

    $zk->ssr(); 
  • Pin Width
php
//    get  Pin Width
//    this return bool/mixed

    $zk->pinWidth(); 
  • Serial Number
php
//    get device serial number
//    this return bool/mixed

    $zk->serialNumber(); 
  • Device Name
php
//    get device name
//    this return bool/mixed

    $zk->deviceName(); 
  • Get Device Time
php
//    get device time

//    return bool/mixed bool|mixed Format: "Y-m-d H:i:s"

    $zk->getTime(); 
  • Set Device Time
php
//    set device time
//    parameter string $t Format: "Y-m-d H:i:s"
//    return bool/mixed

    $zk->setTime(); 
  • Get Users
php
//    get User
//    this return array[]

    $zk->getUser(); 
  • Set Users
php
//    set user

//    1 s't parameter int $uid Unique ID (max 65535)
//    2 nd parameter int|string $userid ID in DB (same like $uid, max length = 9, only numbers - depends device setting)
//    3 rd parameter string $name (max length = 24)
//    4 th parameter int|string $password (max length = 8, only numbers - depends device setting)
//    5 th parameter int $role Default Util::LEVEL_USER
//    6 th parameter int $cardno Default 0 (max length = 10, only numbers

//    return bool|mixed

    $zk->setUser(); 
  • Clear All Admin
php
//    remove all admin
//    return bool|mixed

    $zk->clearAdmin(); 
  • Clear All Users
php
//    remove all users
//    return bool|mixed

    $zk->clearAdmin(); 
  • Remove A User
php
//    remove a user by $uid
//    parameter integer $uid
//    return bool|mixed

    $zk->removeUser(); 
  • Get Attendance Log
…
  • Clear Attendance Log
php
//    clear attendance log

//    return bool/mixed

    $zk->clearAttendance(); 

end

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHP

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言