'decimal:2', 'is_passed' => 'boolean', 'assessment_date' => 'date', ]; /** * Get the employee training for this assessment result. */ public function employeeTraining() { return $this->belongsTo(EmployeeTraining::class); } /** * Get the training assessment for this result. */ public function trainingAssessment() { return $this->belongsTo(TrainingAssessment::class); } /** * Get the user who assessed this result. */ public function assessor() { return $this->belongsTo(User::class, 'assessed_by'); } /** * Scope a query to only include passed results. */ public function scopePassed($query) { return $query->where('is_passed', true); } /** * Scope a query to only include failed results. */ public function scopeFailed($query) { return $query->where('is_passed', false); } }