initial commit

This commit is contained in:
2026-04-13 08:16:56 +08:00
parent 610676a668
commit 273c8e8153
1270 changed files with 331207 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class TrainingType extends BaseModel
{
use HasFactory;
protected $fillable = [
'name',
'description',
'branch_id',
'created_by'
];
/**
* Get the user who created this training type.
*/
public function creator()
{
return $this->belongsTo(User::class, 'created_by');
}
/**
* Get the branch this training type belongs to.
*/
public function branch()
{
return $this->belongsTo(Branch::class);
}
/**
* Get the departments associated with this training type.
*/
public function departments()
{
return $this->belongsToMany(Department::class, 'training_type_department');
}
/**
* Get the training programs of this type.
*/
public function trainingPrograms()
{
return $this->hasMany(TrainingProgram::class);
}
}