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

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

maliklibs/zkteco
================

ZKTeco Laravel Library - Compatible with Laravel 6, 8, 9, 10

91.8k2PHPCI passing

Since Aug 9Pushed 9mo ago1 watchersCompare

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

READMEChangelogDependenciesVersions (3)Used By (0)

UnOfficial ZKTeco - Laravel Library
===================================

[](#unofficial-zkteco---laravel-library)

[![Issues](https://camo.githubusercontent.com/7464bfe78c33e087a4a24c8bbc4aef7d9740f4300bc7b003cbcf70274cc5105d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f736b65746368746563686e6f6c6f67696573312f7a6b7465636f3f7374796c653d666c61742d737175617265)](https://github.com/sketchtechnologies1/zkteco/issues)[![Forks](https://camo.githubusercontent.com/c61ea4ee08064f49981138b237f3af602ade3646217a3f5035ee9e11a9ed0f9b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f736b65746368746563686e6f6c6f67696573312f7a6b7465636f3f7374796c653d666c61742d737175617265)](https://github.com/sketchtechnologies1/zkteco/network/members)[![Stars](https://camo.githubusercontent.com/0f3cdc0ff61fe08504137139daa61926851973ed078d9a638cc7a2bad5cf9583/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f736b65746368746563686e6f6c6f67696573312f7a6b7465636f3f7374796c653d666c61742d737175617265)](https://github.com/sketchtechnologies1/zkteco/stargazers)[![Total Downloads](https://camo.githubusercontent.com/b729ca56dde3c97c35036cfdcbd256230562e63eaad32863d39c9f103b38981c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d616c696b6c6962732f7a6b7465636f3f7374796c653d666c61742d737175617265)](https://packagist.org/packages/maliklibs/zkteco)[![License](https://camo.githubusercontent.com/fba222a9cb42cf7b971fd9ec6b6f2c30a4b23a762f22806a621bd08167efcb21/68747470733a2f2f706f7365722e707567782e6f72672f6d616c696b6c6962732f7a6b7465636f2f6c6963656e73652e737667)](https://packagist.org/packages/maliklibs/zkteco)[![Laravel Version](https://camo.githubusercontent.com/565b3e207c917c20ba58efad7d772e84e49fd6f0b0976bc63a58bc13ed528028/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d362e78253230253743253230382e78253230253743253230392e7825323025374325323031302e782d627269676874677265656e2e737667)](https://laravel.com)

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

**Requires:** **Laravel** &gt;= **6.0** | **PHP** &gt;= **7.4**

**Compatible with:** Laravel 6.x, 8.x, 9.x, 10.x

**License:** MIT or later

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

[](#installation)

You can install the package via composer:

```
composer require maliklibs/zkteco
```

The package will automatically register itself.

### Configuration (Optional)

[](#configuration-optional)

Publish the configuration file:

```
php artisan vendor:publish --provider="maliklibs\Zkteco\Providers\ZktecoServiceProvider" --tag="zkteco-config"
```

This will create a `config/zkteco.php` file where you can customize the default settings.

### Environment Variables

[](#environment-variables)

You can also set these environment variables in your `.env` file:

```
ZKTECO_IP=192.168.1.201
ZKTECO_PORT=4370
ZKTECO_TIMEOUT=5
ZKTECO_DEBUG=false
```

Usage
-----

[](#usage)

### Method 1: Using Facade (Recommended)

[](#method-1-using-facade-recommended)

```
use maliklibs\Zkteco\Facades\ZKTeco;

// Connect to device
ZKTeco::connect();

// Get device version
$version = ZKTeco::version();

// Get users
$users = ZKTeco::getUser();

// Get attendance
$attendance = ZKTeco::getAttendance();

// Disconnect
ZKTeco::disconnect();
```

### Method 2: Using Dependency Injection

[](#method-2-using-dependency-injection)

```
use maliklibs\Zkteco\Lib\ZKTeco;

class AttendanceController extends Controller
{
    public function index(ZKTeco $zk)
    {
        $zk->connect();
        $attendance = $zk->getAttendance();
        $zk->disconnect();

        return response()->json($attendance);
    }
}
```

### Method 3: Manual Instantiation

[](#method-3-manual-instantiation)

```
use maliklibs\Zkteco\Lib\ZKTeco;

// 1st parameter is string $ip Device IP Address
// 2nd parameter is integer $port Default: 4370
// 3rd parameter is integer seconds (socket default read timeout)
$zk = new ZKTeco('192.168.1.201', 4370, 5);

// Connect
$zk->connect();

// Use device methods
$version = $zk->version();
$users = $zk->getUser();

// Disconnect
$zk->disconnect();
```

Available Methods
-----------------

[](#available-methods)

### Connection Management

[](#connection-management)

- **Connect**

```
// Connect to device
// Returns bool
$zk->connect();
```

- **Disconnect**

```
// Disconnect from device
// Returns bool
$zk->disconnect();
```

### Device Control

[](#device-control)

- **Enable Device**

```
// Enable device
// Returns bool/mixed
$zk->enableDevice();
```

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

- **Disable Device**

```
// Disable device
// Returns bool/mixed
$zk->disableDevice();
```

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

- **Power Off**

```
// Turn off the device
// Returns bool/mixed
$zk->shutdown();
```

- **Restart**

```
// Restart the device
// Returns bool/mixed
$zk->restart();
```

- **Sleep**

```
// Sleep the device
// Returns bool/mixed
$zk->sleep();
```

- **Resume**

```
// Resume the device from sleep
// Returns bool/mixed
$zk->resume();
```

### Device Information

[](#device-information)

- **Device Version**

```
// Get device version
// Returns bool/mixed
$zk->version();
```

- **Device OS Version**

```
// Get device OS version
// Returns bool/mixed
$zk->osVersion();
```

- **Platform**

```
// Get platform
// Returns bool/mixed
$zk->platform();
```

- **Firmware Version**

```
// Get firmware version
// Returns bool/mixed
$zk->fmVersion();
```

- **Serial Number**

```

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance40

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/87e090fb7c3940618cc5481c8ba85d52047ca15d1d7eadd14d9c376b983b7ac3?d=identicon)[malikwaqas](/maintainers/malikwaqas)

---

Top Contributors

[![malikwaqasmustafa](https://avatars.githubusercontent.com/u/16215342?v=4)](https://github.com/malikwaqasmustafa "malikwaqasmustafa (11 commits)")

### Embed Badge

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

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

###  Alternatives

[yii2mod/yii2-markdown

Markdown Widget for Yii2

1347.7k5](/packages/yii2mod-yii2-markdown)[splitbrain/php-ringicon

A indenticon/glyphicon like avatar generator

1613.3k1](/packages/splitbrain-php-ringicon)[willywes/agora-sdk-php

Agora.io SDK PHP

1023.2k2](/packages/willywes-agora-sdk-php)

PHPackages © 2026

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