54 lines
1.1 KiB
PHP
54 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Modules\Training\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Modules\Admin\Models\Department;
|
|
use Modules\Employee\Models\Employee;
|
|
use Modules\Training\Database\factories\TrainingListFactory;
|
|
|
|
class TrainingList extends Model
|
|
{
|
|
use HasFactory;
|
|
protected $table = 'tbl_training_lists';
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*/
|
|
protected $fillable = [
|
|
'title',
|
|
'training_by',
|
|
'trainer_id',
|
|
'assigned_id',
|
|
'start_date',
|
|
'end_date',
|
|
'department_id',
|
|
'shift',
|
|
'status',
|
|
'remarks',
|
|
];
|
|
|
|
protected static function newFactory(): TrainingListFactory
|
|
{
|
|
//return TrainingListFactory::new();
|
|
}
|
|
|
|
public function employee()
|
|
{
|
|
return $this->belongsTo(Employee::class, 'assigned_id');
|
|
}
|
|
|
|
public function trainer()
|
|
{
|
|
return $this->belongsTo(Trainer::class,'trainer_id');
|
|
}
|
|
|
|
public function department()
|
|
{
|
|
return $this->belongsTo(Department::class,'department_id');
|
|
}
|
|
|
|
|
|
}
|