first commit
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\LevelEducational;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class EducationalProgram extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $guarded = false;
|
||||
|
||||
|
||||
protected $casts = [
|
||||
'program_features' => 'array',
|
||||
'about_program' => 'array',
|
||||
'learning_forms' => 'array',
|
||||
'lvl_edu' => LevelEducational::class,
|
||||
];
|
||||
|
||||
public function directionStudy()
|
||||
{
|
||||
return $this->belongsTo(DirectionStudy::class);
|
||||
}
|
||||
|
||||
public function departments()
|
||||
{
|
||||
return $this->belongsToMany(Department::class, 'program_department');
|
||||
}
|
||||
|
||||
|
||||
public function admission_plans()
|
||||
{
|
||||
return $this->hasMany(AdmissionPlan::class, 'educational_programs_id', 'id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user