2024-02-08 15:59:44 +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-10 15:14:02 +03:00
|
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
2024-02-08 15:59:44 +03:00
|
|
|
|
|
|
|
class Department extends Model
|
|
|
|
{
|
|
|
|
use HasFactory;
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
'id',
|
|
|
|
'name',
|
|
|
|
'description',
|
|
|
|
'position',
|
|
|
|
];
|
|
|
|
|
|
|
|
public function faculty(): BelongsTo
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Faculty::class);
|
|
|
|
}
|
2024-02-10 15:14:02 +03:00
|
|
|
|
|
|
|
public function directions(): HasMany
|
|
|
|
{
|
|
|
|
return $this->hasMany('App\Models\Direction', 'department_id');
|
|
|
|
}
|
2024-02-08 15:59:44 +03:00
|
|
|
}
|