1
0
mirror of https://github.com/robonen/education-project.git synced 2026-03-20 02:44:31 +00:00
Files
education-project/app/Models/Task.php
2020-12-09 19:02:38 +07:00

26 lines
539 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Task extends Model
{
use HasFactory;
protected $fillable = ['name', 'description', 'deadline', 'teacher_id', 'subject_id'];
public function banktask() {
return $this->hasMany(BankTask::class, 'class_task');
}
public function teacher(){
return $this->belongsTo(Teacher::class);
}
public function class() {
$this->belongsTo(SchoolClass::class);
}
}