Before any attendance can be recorded — whether via QR scan, facial recognition, or manual roll call — an administrator or coordinator must open aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Elian-D/ORVIAN/llms.txt
Use this file to discover all available pages before exploring further.
DailyAttendanceSession for the day. A session represents a single school shift (tanda) on a specific calendar date. Each school may run multiple sessions per day if it operates multiple shifts (e.g. morning and afternoon). Days on which no session is opened are treated by the system as non-school days (holidays or closures) and appear as blank in the dashboard calendar and in all reports and charts.
Days without an opened session are treated as holidays in all reports and ApexCharts visualisations. If a session was accidentally never opened for a real school day, you can open it retroactively from the Session Hub — the historical records will then be available for entry.
Session States
ADailyAttendanceSession moves through the following states during its lifecycle:
| State | Description | closed_at value |
|---|---|---|
| Open | The session is active. Attendance recording is permitted for the associated shift. The dashboard calendar shows an amber indicator. | NULL |
| Closed | The session has been finalised for the day. PlantelAttendanceService::markAbsences() runs during close, auto-creating absence records for any enrolled students in the shift who have no entry record. KPI totals (total_present, total_late, total_absent, total_excused) are written to the session row. | timestamp |
isOpen(): bool helper that returns true when closed_at is NULL. There is no separate “Under Review” state on the session record itself — auditing is an access-control layer (the audit view at /app/attendance/audit/{sessionId} requires attendance_plantel.verify) applied on top of closed sessions.
Opening a Session
Navigate to/app/attendance/session (requires attendance_plantel.open_session). The AttendanceSessionManager Livewire component loads all school shifts configured for the tenant and displays a card per shift showing its current-day session state.
To open a session:
- Identify the shift card for the tanda you want to open (e.g. Matutina, Vespertina).
- Click Abrir Sesión.
AttendanceSessionManager::openSession()callsPlantelAttendanceService::openDailySession(), which:- Checks that no session already exists for this school + date + shift combination.
- Counts all active students enrolled in that shift (
Student::active()->inShift($shiftId)->count()) and stores the result astotal_expected. - Creates the
DailyAttendanceSessionrecord withopened_at = now()andopened_by = Auth::id().
- The card refreshes and recording tools become available for that shift.
Closing a Session
Closing is initiated from the Session Hub (see below) or from theAttendanceSessionManager. When you click Cerrar Sesión, the component calls confirmCloseSession(), which:
- Finds all students in the shift who have no entry record yet (pending students).
- Queries
ExcuseService::getCoveredStudentsForDate()to determine how many of those pending students have an approved excuse for today. - Projects the final absent and excused counts (real recorded + projected unrecorded).
- Opens a confirmation modal showing the projected summary before you commit.
closeSession() is called (requires attendance_plantel.close_session), which:
- Calls
PlantelAttendanceService::markAbsences()— createsPlantelAttendanceRecordrows for all students still without a record, automatically assigningexcusedstatus to those with an approved excuse andabsentto the rest. - Calls
PlantelAttendanceService::closeDailySession()— stampsclosed_at,closed_by, and writes the final KPI columns.
Session Hub
The Session Hub at/app/attendance/hub (requires attendance_plantel.view) is the central session management view. It displays historical sessions across all shifts, with the ability to:
- See open and closed sessions for any past date using the date picker.
- Open a session for today directly from the hub (delegates to the same
openSessionflow). - Initiate a session close and view the pre-close summary modal.
- Navigate to the audit trail for any closed session.
Audit Trail
The audit view at/app/attendance/audit/{sessionId} (requires attendance_plantel.verify) provides a full record of session activity for a specific DailyAttendanceSession:
- Who opened the session and at what time (
opened_by→ User,opened_attimestamp). - Who closed the session and at what time (
closed_by→ User,closed_attimestamp). - Final KPIs at close:
total_expected,total_registered,total_present,total_late,total_absent,total_excused. - Individual attendance records within the session, including entry time, recording method, and any metadata flags (e.g.
license_alert). - Change log of any status corrections made after initial recording.
Demo Data
To populate realistic historical sessions for testing or demonstrations, use theorvian:seed-demo Artisan command:
DailyAttendanceSession and PlantelAttendanceRecord entries for every weekday (Monday–Friday) in the specified range. Weekends are automatically skipped — no session is created for Saturday or Sunday. The demo distribution is:
- Plantel: 80% present · 10% late · 5% absent · 5% excused
- Classroom: 75% present · 10% late · 10% absent · 5% excused (for students who were present at Plantel), generating realistic pasilleo discrepancies visible in the dashboard.
AttendanceExcuse records (status: approved) are also created for random students.