A PHP-based integration solution for ZKTeco devices, focusing on attendance management. This project enables seamless communication with ZKTeco devices, retrieves attendance records, and manages attendance data in a Laravel application.
- Device Connection: Establishes a connection with ZKTeco attendance devices.
- Attendance Retrieval: Fetches attendance records from the device.
- Database Management: Stores attendance data in the local database using Eloquent models.
- Automated Sync: Automatically syncs attendance data with a remote CMS through API requests.
- Error Handling: Logs connection attempts, errors, and duplicate records.
-
Clone the repository:
git clone https://github.com/sadi-tanvir/ZKTeco-Attendance-Integration-Laravel.git
-
Navigate to the project directory:
cd ZKTeco-Attendance-Integration-Laravel
-
Install dependencies:
composer install
-
Configure your
.env
file:Copy the
.env.example
to.env
and update the database and other configurations according to your environment.cp .env.example .env
To send attendance information to your database, you need to specify your API URL in the
.env
file. Follow these steps:-
Open your
.env
file. -
Add the following line to specify your API endpoint. Replace
https://example.com/api/create-attendance
with your actual API URL:
CMS_API_URL=https://example.com/api/create-attendance
-
This configuration allows your application to send attendance data to the specified API endpoint.
-
Generate application key:
php artisan key:generate
To streamline your development workflow, a batch script (larvel.bat
) is provided to start the Laravel server and run the scheduler worker simultaneously.
@echo off
cd /d "D:\laragon\www\teco_v1"
start "" "D:\laragon\bin\php\php-8.2\php.exe" artisan serve
start "" "D:\laragon\bin\php\php-8.2\php.exe" artisan schedule:work
pause