PHPackages                             mehedijaman/laravel-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. mehedijaman/laravel-zkteco

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

mehedijaman/laravel-zkteco
==========================

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

v1.0.1(1y ago)454.1k↓40.9%26[2 issues](https://github.com/mehedijaman/laravel-zkteco/issues)[2 PRs](https://github.com/mehedijaman/laravel-zkteco/pulls)MITPHPPHP ^8.2CI passing

Since Jun 13Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/mehedijaman/laravel-zkteco)[ Packagist](https://packagist.org/packages/mehedijaman/laravel-zkteco)[ Docs](https://github.com/mehedijaman/laravel-zkteco)[ GitHub Sponsors](https://github.com/MehediJaman)[ RSS](/packages/mehedijaman-laravel-zkteco/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (13)Versions (3)Used By (0)

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

[](#laravel-zkteco-integration)

[![Latest Version on Packagist](https://camo.githubusercontent.com/850a4a02ed63d967981f526bdab542e7c31a9ceebad21cd5c3bfdb9c4c56fa47/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d65686564696a616d616e2f6c61726176656c2d7a6b7465636f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mehedijaman/laravel-zkteco)[![GitHub Tests Action Status](https://camo.githubusercontent.com/1cdd44774cd0d1fd3e0f14ccd22fecbfb3b89f1b08045938ac7e4982ae2fb380/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d65686564696a616d616e2f6c61726176656c2d7a6b7465636f2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/mehedijaman/laravel-zkteco/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/8cbbbfb8f8c7c48eb3ae757e0b936bcdef757f98af2492a872ac1d63674d72ea/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d65686564696a616d616e2f6c61726176656c2d7a6b7465636f2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/mehedijaman/laravel-zkteco/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/97391083b6b76b5f9f4452b5060f6c2b39ff6640ed476265e04092403c1199ac/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d65686564696a616d616e2f6c61726176656c2d7a6b7465636f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mehedijaman/laravel-zkteco)

Overview
--------

[](#overview)

The Laravel 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
--------

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

[](#installation)

You can install the package via composer:

```
composer require mehedijaman/laravel-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 LaravelZkteco Object.

```
use MehediJaman\LaravelZkteco\LaravelZkteco;
$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. */
//              ]

    $zk->getAttendance();
```

- **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)

- [Mehedi Jaman](https://github.com/mehedijaman)

License
-------

[](#license)

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

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance64

Regular maintenance activity

Popularity38

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 59.5% 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

Unknown

Total

1

Last Release

705d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2dcf8478d6909bdca956e70280f64184cc98a9c480e4ad09e2aeea947afbde0a?d=identicon)[mehedijaman](/maintainers/mehedijaman)

---

Top Contributors

[![mehedijaman](https://avatars.githubusercontent.com/u/8464835?v=4)](https://github.com/mehedijaman "mehedijaman (22 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (6 commits)")[![HichemBenali](https://avatars.githubusercontent.com/u/44532208?v=4)](https://github.com/HichemBenali "HichemBenali (1 commits)")

---

Tags

fingerprintlaraveltime-attendancezktecolaravelFingerprintzktecoTimeAttendance

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.8k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

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