Roman_applicant-site/app/Models/Subject.php

26 lines
499 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Subject extends Model
{
use HasFactory;
protected $fillable = [
'id',
'name',
'description',
'slug',
'position',
];
public function entranceExaminations(): HasMany
{
return $this->hasMany('App\Models\EntranceExamination', 'subject_id');
}
}