mirror of
https://github.com/robonen/education-project.git
synced 2026-03-20 19:04:31 +00:00
28 lines
520 B
PHP
28 lines
520 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Subject extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
];
|
|
|
|
public function banktasks()
|
|
{
|
|
return $this->hasMany(BankTask::class);
|
|
}
|
|
|
|
public function schoolClasses()
|
|
{
|
|
return $this->belongsToMany(SchoolClass::class, 'academic_plans', 'class_id')
|
|
->withPivot('hours_per_week', 'hours_per_year');
|
|
}
|
|
|
|
}
|