first commit

This commit is contained in:
f4ilji
2024-09-19 16:06:49 +05:00
commit b686638a39
1664 changed files with 428174 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Department extends Model
{
use HasFactory;
protected $guarded = false;
protected $casts = [
'content' => 'array',
];
public function faculty()
{
return $this->belongsTo(Faculty::class);
}
public function workers()
{
return $this->belongsToMany(User::class, 'workers_departments')->withPivot(['position']);
}
public function programs()
{
return $this->belongsToMany(EducationalProgram::class, 'program_department');
}
public function teachers()
{
return $this->belongsToMany(User::class, 'teachers_departments')->withPivot(['teaching_position']);
}
}