27 lines
604 B
PHP
27 lines
604 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Attendances extends Model
|
|
{
|
|
protected $fillable = ['student_id', 'teacher_subject_id', 'date', 'status', 'recorded_by', 'semester', 'notes'];
|
|
|
|
public function student()
|
|
{
|
|
return $this->belongsTo(Student::class, 'student_id');
|
|
}
|
|
|
|
public function teacherSubject()
|
|
{
|
|
return $this->belongsTo(TeacherSubject::class, 'teacher_subject_id');
|
|
}
|
|
|
|
// Relasi dengan guru yang merekam
|
|
public function recorder()
|
|
{
|
|
return $this->belongsTo(User::class, 'recorded_by');
|
|
}
|
|
}
|