PHPackages                             fsuuaas/zkteco - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fsuuaas/zkteco

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fsuuaas/zkteco
==============

Laravel library for ZKTeco Attendance Machine

1.0.4(1y ago)1988↓33.3%2MITPHP

Since Jan 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/fsuuaas/zkteco)[ Packagist](https://packagist.org/packages/fsuuaas/zkteco)[ RSS](/packages/fsuuaas-zkteco/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)DependenciesVersions (6)Used By (0)

Laravel ZKTeco Integration
==========================

[](#laravel-zkteco-integration)

Overview
--------

[](#overview)

The Laravel ZKTeco package offers a seamless way to integrate ZKTeco biometric devices with your Laravel application. It simplifies tasks such as connecting to devices, managing users, and retrieving attendance logs. With its intuitive API, developers can easily extract data like registered users, real-time logs, and device details, as well as add new users or clear attendance records. Utilizing a reliable socket connection, the package ensures fast and efficient data exchange, making it an essential tool for building attendance systems or time management applications.

Features
--------

[](#features)

- **Effortless Integration:** Quickly connect ZKTeco biometric devices to your Laravel application with minimal setup.
- **Comprehensive Attendance Management:** Fetch, view, and manage attendance logs efficiently.
- **User Management Made Easy:** Add, update, or remove users directly from your application with full control.
- **Real-Time Data Synchronization:** Always access up-to-date attendance and user data without delays.
- **Advanced Device Control:** Manage device settings such as enabling/disabling devices, clearing logs, or restarting devices effortlessly.
- **Enhanced Fingerprint Handling:** Retrieve, add, or remove fingerprint data with robust support.
- **Device Information Access:** Obtain crucial details like version, OS, platform, serial number, and more.
- **Custom Time Management:** Sync or update the device’s internal clock for precise record-keeping.

---

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require fsuuaas/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
-------------------

[](#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
-----

[](#usage)

Instantiate the Zkteco Object.

```
use Fsuuaas\Zkteco\Zkteco;
$zk = new LaravelZkteco('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. */
//              ]
//      Pass parameter of record size for latest devices like as: Speedface V5L using 49 bytes.
// Most of the old device using 40 bytes of record size, Example: iClock 680.
// For Old Device parameter is optional
    $zk->getAttendance(49);
```

- **Clear Attendance Log**

```
//    clear attendance log

//    return bool/mixed

    $zk->clearAttendance();
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Raihan\_Afroz](https://github.com/raihanafroz)
- [Coding\_Libs](https://github.com/coding-libs)
- [adrobinoga](https://github.com/adrobinoga)
- [Mehedi Jaman](https://github.com/mehedijaman)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance42

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

481d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9248893?v=4)[Sharif Uddin Ahamed](/maintainers/fsuuaas)[@fsuuaas](https://github.com/fsuuaas)

---

Top Contributors

[![fsuuaas](https://avatars.githubusercontent.com/u/9248893?v=4)](https://github.com/fsuuaas "fsuuaas (7 commits)")

### Embed Badge

![Health badge](/badges/fsuuaas-zkteco/health.svg)

```
[![Health](https://phpackages.com/badges/fsuuaas-zkteco/health.svg)](https://phpackages.com/packages/fsuuaas-zkteco)
```

###  Alternatives

[bitwasp/buffertools

Toolbox for working with binary and hex data. Similar to NodeJS Buffer.

65764.4k41](/packages/bitwasp-buffertools)[reefki/laravel-device-detector

Laravel wrapper for Matomo's Universal Device Detection library.

2852.6k](/packages/reefki-laravel-device-detector)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
