MIF_E31221451/app/Models/Student.php

40 lines
689 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Student extends Model
{
protected $table = 'student';
protected $fillable = [
'nis',
'name',
'date_of_birth',
'place_of_birth',
'classroom_id',
'user_id',
'avatar_url',
];
public function classroom()
{
return $this->belongsTo(Classroom::class);
}
public function user()
{
return $this->belongsTo(User::class);
}
public function tasks()
{
return $this->hasMany(StudentTask::class);
}
public function growths()
{
return $this->hasMany(StudentGrowth::class);
}
}