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/Subject.php
2020-12-09 13:42:28 +07:00

33 lines
598 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',
];
protected $hidden = [
'created_at',
'updated_at',
];
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');
}
}