eduplus/attendance
Composer 安装命令:
composer require eduplus/attendance
包简介
PHP SDK for Eduplus Attendance - Centralized Attendance Data Collection System
README 文档
README
A PHP SDK for interacting with the Eduplus Attendance API — Centralized Attendance Data Collection System. Built with Guzzle HTTP.
Requirements
- PHP 7.4 or higher
- Guzzle HTTP 6.5+ or 7.0+ (automatically installed via Composer)
Installation
composer require eduplus/attendance
Quick Start
<?php require_once 'vendor/autoload.php'; use Eduplus\EduplusAttendance; // Get today's attendance $records = EduplusAttendance::setApiKey('your-api-key') ->attendance([ 'start' => date('Y-m-d'), 'end' => date('Y-m-d'), ]); foreach ($records as $r) { echo "{$r['person_identifier']} — {$r['first_checkin']} to {$r['last_checkout']}\n"; }
Configuration
use Eduplus\EduplusAttendance; // Set API key (required) EduplusAttendance::setApiKey('your-api-key'); // Override base URL for staging/local (optional) EduplusAttendance::setBaseUrl('https://staging.attendance.example.com');
Usage
Attendance
$sdk = EduplusAttendance::setApiKey('your-api-key'); // List attendance with filters $records = $sdk->attendance([ 'start' => '2026-04-01', 'end' => '2026-04-30', 'person_identifier' => 'REG001', // optional 'machine' => '5th_floor', // optional: machine identifier or ID 'tags' => 'students,main_building', // optional: comma-separated ]); // Attendance for a specific date $records = $sdk->attendanceForDate('2026-04-30'); // With late/absent status rules $records = $sdk->attendanceForDate('2026-04-30', [ 'late_time' => '09:30', // global: checkin after 09:30 = late 'absent_time' => '10:00', // global: checkin after 10:00 = absent 'rules' => [ // per-person overrides 'REG001' => ['late_time' => '09:00', 'absent_time' => '09:15'], 'REG002' => ['late_time' => '10:00'], ], ]); // Attendance for a specific person $records = $sdk->personAttendance('REG001', [ 'start' => '2026-04-01', 'end' => '2026-04-30', ]);
Punches
$sdk = EduplusAttendance::setApiKey('your-api-key'); // List punches with filters $punches = $sdk->punches([ 'start' => '2026-04-30', 'end' => '2026-04-30', 'person_identifier' => 'REG001', 'machine' => 'main_gate', 'tags' => 'teachers', ]); // Punches for a specific person $punches = $sdk->personPunches('REG001', [ 'start' => '2026-04-30', 'end' => '2026-04-30', ]);
Machines
$machines = EduplusAttendance::setApiKey('your-api-key')->machines(); foreach ($machines as $m) { echo "[{$m['identifier']}] {$m['label']} — {$m['vendor']} — Tags: " . implode(', ', $m['tags']) . "\n"; }
API Reference
setApiKey(string $apiKey): EduplusAttendance
Set the API key. Returns a new instance for chaining.
setBaseUrl(string $url): void
Override the base URL. Default: https://attendance.eduplus-bd.com
attendance(array $filters = []): array
Get attendance records. Filters: start, end, person_identifier, machine, tags
attendanceForDate(string $date, array $filters = []): array
Get attendance for a date. Extra filters: late_time, absent_time, rules
personAttendance(string $id, array $filters = []): array
Get attendance for a person. Filters: start, end, machine, tags
punches(array $filters = []): array
Get raw punches. Filters: start, end, person_identifier, machine, tags
personPunches(string $id, array $filters = []): array
Get punches for a person. Filters: start, end, machine, tags
machines(): array
Get all machines for the authenticated client.
Response Format
Attendance Record
[
'person_identifier' => 'REG001',
'date' => '2026-04-30',
'first_checkin' => '08:15:00',
'last_checkout' => '17:02:00',
'total_minutes_inside' => 480,
'total_minutes_outside' => 47,
'punch_count' => 4,
'status' => 'present',
]
Punch Record
[
'person_identifier' => 'REG001',
'person_name' => 'John Doe',
'punched_at' => '2026-04-30 08:15:23',
'punch_type' => 'fingerprint', // fingerprint, card, face, unknown
'device_identifier' => 'DEV01',
'location' => null,
]
Machine Record
[
'identifier' => '5th_floor',
'label' => '5th Floor Machine',
'vendor' => 'stellar',
'timezone' => 'Asia/Dhaka',
'is_active' => true,
'sync_status' => 'success',
'last_synced_at' => '2026-04-30 12:00:00',
'last_collected_at' => '2026-04-30 12:01:00',
'tags' => ['students', 'main_building'],
]
Filter Reference
| Filter | Type | Used In | Description |
|---|---|---|---|
start |
date (Y-m-d) | attendance, punches | Start date |
end |
date (Y-m-d) | attendance, punches | End date |
person_identifier |
string | attendance, punches | Filter by person |
machine |
string/int | all | Machine identifier or numeric ID |
tags |
string | all | Comma-separated tag names. Returns data from machines that have ALL specified tags |
late_time |
time (HH:MM) | attendanceForDate | Global late threshold |
absent_time |
time (HH:MM) | attendanceForDate | Global absent threshold |
rules |
array | attendanceForDate | Per-person late/absent overrides |
Error Handling
The SDK never throws exceptions. All methods return arrays:
- Success: Returns the data array from the API
- Error/No data: Returns an empty array
[]
$records = $sdk->attendance(['start' => '2026-04-30', 'end' => '2026-04-30']); if (empty($records)) { echo "No records found or API error\n"; } else { echo "Found " . count($records) . " records\n"; }
License
MIT — see LICENSE file.
eduplus/attendance 适用场景与选型建议
eduplus/attendance 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 05 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「sdk」 「Punch」 「attendance」 「biometric」 「eduplus」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 eduplus/attendance 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 eduplus/attendance 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 eduplus/attendance 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Simple timesheets and vacation management for small businesses.
A lightweight plain-PHP framework for database-backed CRUD APIs.
Modern, strongly-typed, PSR-compliant PHP client for the WeFact v2 API.
PHP SDK for the Enconvert file conversion API
支付宝开放平台v3协议文档,支持最新版PHP8+
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 28
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-01