mirror of
https://github.com/robonen/education-project.git
synced 2026-03-20 02:44:31 +00:00
# Conflicts: # app/Http/Controllers/Users/StudentController.php # app/Models/SchoolClass.php # app/Models/Teacher.php # composer.json # composer.lock # database/migrations/2020_12_03_104028_create_bank_task_files_table.php # routes/api.php
36 lines
654 B
PHP
36 lines
654 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Facades\Validator;
|
|
|
|
class Teacher extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
];
|
|
|
|
public function schoolClass()
|
|
{
|
|
return $this->hasOne(SchoolClass::class, 'classroom_teacher');
|
|
}
|
|
|
|
public function timetables()
|
|
{
|
|
return $this->hasMany(Timetable::class);
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function tasks(){
|
|
return $this->hasMany(Task::class);
|
|
}
|
|
}
|