applicant-site/app/Models/Direction.php

43 lines
914 B
PHP
Raw Normal View History

2024-02-10 11:23:38 +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-19 10:51:20 +03:00
use Illuminate\Database\Eloquent\Relations\HasMany;
2024-02-10 11:23:38 +03:00
class Direction extends Model
{
use HasFactory;
protected $fillable = [
'id',
'name',
'description',
'position',
2024-02-14 16:16:44 +03:00
'slug',
'code',
2024-02-10 11:23:38 +03:00
];
public function department(): BelongsTo
{
return $this->belongsTo(Department::class);
}
2024-02-14 16:16:44 +03:00
public function educationLevel(): BelongsTo
{
return $this->belongsTo(EducationLevel::class);
}
2024-02-15 09:58:01 +03:00
public function educationForm(): BelongsTo
{
return $this->belongsTo(EducationForm::class);
}
2024-02-19 10:51:20 +03:00
public function entranceExaminations(): HasMany
{
return $this->hasMany('App\Models\EntranceExamination', 'direction_id');
}
2024-02-10 11:23:38 +03:00
}