1
0
mirror of https://github.com/robonen/education-project.git synced 2026-03-20 19:04:31 +00:00
Files
education-project/app/Models/SchoolClass.php
nikden13 045a767774 auth
2020-12-16 03:13:20 +07:00

36 lines
670 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class SchoolClass extends Model
{
use HasFactory;
protected $fillable = [
'number',
'letter',
'profile',
];
public function students()
{
return $this->hasMany(Student::class, 'class_id');
}
public function subjects()
{
return $this->belongsToMany(Subject::class, 'academic_plans', 'class_id')
->withPivot('hours_per_week', 'hours_per_year');
}
public function chatLinks()
{
return $this->hasMany(ChatLink::class, 'class_id');
}
}