@extends('layouts.app') @section('page-title', 'Biometric Settings') @section('content')

Biometric Attendance Settings

@if(session('success')) @endif
Module Status

Status: @if($gym->attendance_enabled) Enabled @else Disabled @endif

@if($gym->attendance_enabled) Biometric attendance is active. Your device can send attendance data. @else Biometric attendance is disabled. Enable it in gym settings to use this feature. @endif

Gym Information

Gym Name: {{ $gym->name }}

Gym ID: {{ $gym->id }}

API Endpoint

Use this URL in your biometric device configuration:

API Key
@csrf

Use this API key to authenticate requests from your biometric device:

How to use:
  • Include the API key in the Authorization header: Bearer {{ $gym->biometric_api_key }}
  • Or use the X-API-Key header: {{ $gym->biometric_api_key }}
Last Sync

Last Attendance Sync:
@if($gym->biometric_last_sync) {{ $gym->biometric_last_sync->format('Y-m-d H:i:s') }} ({{ $gym->biometric_last_sync->diffForHumans() }}) @else No sync yet @endif

API Request Examples

Example requests from your biometric device:

Check-In Request:
POST {{ $apiEndpoint }}
Headers:
  Authorization: Bearer {{ $gym->biometric_api_key }}
  Content-Type: application/json

Body (Option 1 - using 'type'):
{
  "member_id": 123,
  "timestamp": "2026-01-12 18:30:00",
  "type": "check_in"
}

Body (Option 2 - using 'punch'):
{
  "member_id": 123,
  "timestamp": "2026-01-12 18:30:00",
  "punch": 0
}
Check-Out Request:
POST {{ $apiEndpoint }}
Headers:
  Authorization: Bearer {{ $gym->biometric_api_key }}
  Content-Type: application/json

Body (Option 1 - using 'type'):
{
  "member_id": 123,
  "timestamp": "2026-01-12 20:30:00",
  "type": "check_out"
}

Body (Option 2 - using 'punch'):
{
  "member_id": 123,
  "timestamp": "2026-01-12 20:30:00",
  "punch": 1
}
Field Notes:
  • member_id: Required - The ID of the member
  • timestamp: Required - Date and time in format "YYYY-MM-DD HH:MM:SS"
  • type: Optional - Use "check_in" or "check_out" (takes precedence over 'punch')
  • punch: Optional - Use 0 for check-in, 1 for check-out
  • If neither 'type' nor 'punch' is provided, it defaults to check-in
@endsection @push('scripts') @endpush