zkfinger-laravel maintained by yacoubalhaidari

ZK Fingerprint Reader Laravel Bridge
A Laravel package to integrate ZKTeco ZKFinger SDK (Biokey.ocx) via a local Windows agent bridge.
⚡ Features
- Enroll, capture, verify, and identify fingerprints using ZKTeco SDK
- Communicates with a local Windows agent (wraps Biokey.ocx)
- Eloquent model for fingerprint templates
- Migration and config publishing
🛠️ Installation
- Require the package (if published to Packagist):
Or add as a local package incomposer require yacoubalhaidari/zkfinger-laravelcomposer.json:
Then run:"repositories": [ { "type": "path", "url": "packages/zk-fingerprint-reader" } ]composer require yacoubalhaidari/zkfinger-laravel - Publish config:
php artisan vendor:publish --tag=zkfinger-config - Run migration:
php artisan migrate - Deploy the local Windows agent (see below).
⚙️ Configuration
Edit config/zkfinger.php as needed. Set the agent URL in your .env:
ZKFINGER_AGENT_URL=http://127.0.0.1:8080
🖥️ Local Windows Agent
You must run a local service on each client machine that wraps the ZKTeco Biokey.ocx ActiveX control and exposes an HTTP API. Example endpoints:
/enroll(POST)/capture(POST)/verify/1:1(POST)/identify/1:N(POST)/cache/create(POST)/cache/add(POST)
See the package documentation or ask for a sample Node.js, Python, or C# agent.
📖 Usage Example
Example controller usage:
use Yacoubalhaidari\ZKFinger\Services\ZKFingerAgentClient;
use Yacoubalhaidari\ZKFinger\Models\FingerprintTemplate;
public function enroll(Request $request, ZKFingerAgentClient $zk) {
$userId = $request->input('user_id');
$result = $zk->enroll($userId);
FingerprintTemplate::create([
'user_id' => $userId,
'template_b64' => $result['template_b64'],
'template_type' => config('zkfinger.template_type'),
'engine_version' => config('zkfinger.engine_version'),
]);
return response()->json(['status' => 'enrolled']);
}
📝 License
MIT