承接 ahsan/ahsan-zkteco 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ahsan/ahsan-zkteco

Composer 安装命令:

composer require ahsan/ahsan-zkteco

包简介

Connect any zkteco fingerprint attendance machine to laravel application with no effort.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Overview

The Ahsan ZKTeco package provides an easy way to integrate ZKTeco biometric devices with your Laravel application. This package simplifies the process of connecting to ZKTeco devices, fetching attendance logs, and managing user data.

Features

  • Easy Integration: Seamlessly connect your Laravel application with ZKTeco biometric devices.
  • Attendance Management: Fetch and manage attendance logs from connected devices.
  • User Management: Add, update, and remove users on the biometric device directly from your application.
  • Real-time Data Sync: Ensure that your application always has the latest attendance data.

Installation

You can install the package via composer:

composer require ahsan-alam-500/ahsan-zkteco

The package is designed to automatically register itself upon installation.

Please ensure that the PHP sockets extension is enabled on your server. If it is not enabled, you will need to activate it.

Activate PHP Socket

Ensure that the PHP sockets extension is enabled on your server. If it is not enabled, follow these steps to activate it:

Locate the php.ini File: The php.ini file's location depends on your PHP installation. Common locations include:

  • /etc/php/8.x/cli/php.ini (for CLI)
  • /etc/php/8.x/apache2/php.ini (for Apache)
  • /etc/php/8.x/fpm/php.ini (for PHP-FPM)

Edit the php.ini File: Open the php.ini file in a text editor with superuser privileges:

sudo nano /etc/php/7.x/apache2/php.ini

Uncomment the Sockets Extension: Find the following line:

;extension=sockets

Remove the semicolon (;) to uncomment the line:

extension=sockets

Save and Exit: Save the changes and exit the editor (Ctrl + X, Y, Enter).

Restart the Web Server: Restart the web server to apply the changes:

sudo systemctl restart apache2

Usage

Instantiate the AhsanZkteco Object.

use Ahsan\AhsanZkteco\AhsanZkteco;
$zk = new AhsanZkteco('ipaddress', 'port');

Call ZKTeco methods

  • Connect
//    connect device
//    this return bool
    $zk->connect();   
  • Disconnect
//    disconnect device
//    this return bool

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

    $zk->enableDevice();   

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

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

    $zk->disableDevice(); 

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    $zk->getUser(); 
  • Set Users
//    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
//    remove all admin
//    return bool|mixed

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

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

    $zk->removeUser(); 
  • Get Attendance Log
//    get attendance log

//    return array[]

//    like as 0 => array:5 [▼
//              "uid" => 1      /* serial number of the attendance */
//              "id" => "1"     /* user id of the application */
//              "state" => 1    /* the authentication type, 1 for Fingerprint, 4 for RF Card etc */
//              "timestamp" => "2020-05-27 21:21:06" /* time of attendance */
//              "type" => 255   /* attendance type, like check-in, check-out, overtime-in, overtime-out, break-in & break-out etc. if attendance type is none of them, it gives  255. */
//              ]

    $zk->getAttendance(); 
  • Clear Attendance Log
//    clear attendance log

//    return bool/mixed

    $zk->clearAttendance(); 

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

ahsan/ahsan-zkteco 适用场景与选型建议

ahsan/ahsan-zkteco 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 08 月 24 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「automation」 「Fingerprint」 「zkteco」 「TimeAttendance」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 ahsan/ahsan-zkteco 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ahsan/ahsan-zkteco 我们能提供哪些服务?
定制开发 / 二次开发

基于 ahsan/ahsan-zkteco 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 36
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-24