Roman_applicant-site/app/Models/Place.php

39 lines
765 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Place extends Model
{
use HasFactory;
protected $fillable = [
'id',
'position',
'description',
'amount',
'quota',
'education_form_id',
'place_type_id',
'direction_id',
];
public function direction(): BelongsTo
{
return $this->belongsTo(Direction::class);
}
public function placeType(): BelongsTo
{
return $this->belongsTo(PlaceType::class);
}
public function educationForm(): BelongsTo
{
return $this->belongsTo(EducationForm::class);
}
}