'boolean', ]; /** * Get the training session for this attendance record. */ public function trainingSession() { return $this->belongsTo(TrainingSession::class); } /** * Get the employee for this attendance record. */ public function employee() { return $this->belongsTo(User::class, 'employee_id'); } /** * Scope a query to only include present attendances. */ public function scopePresent($query) { return $query->where('is_present', true); } /** * Scope a query to only include absent attendances. */ public function scopeAbsent($query) { return $query->where('is_present', false); } }