34 lines
582 B
PHP
34 lines
582 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class StudentTask extends Model
|
|
{
|
|
protected $table = 'student_task';
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'description',
|
|
'classroom_id',
|
|
'subject_id',
|
|
'file',
|
|
];
|
|
|
|
public function classroom()
|
|
{
|
|
return $this->belongsTo(Classroom::class);
|
|
}
|
|
|
|
public function subject()
|
|
{
|
|
return $this->belongsTo(StudentSubject::class);
|
|
}
|
|
|
|
public function nilai()
|
|
{
|
|
return $this->hasMany(StudentGrade::class, 'task_id');
|
|
}
|
|
}
|