2024-02-07 16:30:49 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
2024-02-08 16:01:40 +03:00
|
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
2024-02-07 16:30:49 +03:00
|
|
|
|
|
|
|
class Faculty extends Model
|
|
|
|
{
|
|
|
|
use HasFactory;
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
'id',
|
|
|
|
'name',
|
|
|
|
'description',
|
|
|
|
'position',
|
|
|
|
];
|
|
|
|
|
|
|
|
public function educationalInstitution(): BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(EducationalInstitution::class);
|
|
|
|
}
|
2024-02-08 16:01:40 +03:00
|
|
|
|
|
|
|
public function departments(): HasMany
|
|
|
|
{
|
|
|
|
return $this->hasMany('App\Models\Department', 'faculty_id');
|
|
|
|
}
|
2024-02-07 16:30:49 +03:00
|
|
|
}
|