56 lines
1.3 KiB
PHP
56 lines
1.3 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace Modules\Recruit\Models;
|
||
|
|
||
|
use App\Observers\InterviewScheduleObserver;
|
||
|
use App\Traits\StatusTrait;
|
||
|
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||
|
use Modules\Recruit\Database\factories\InterviewScheduleFactory;
|
||
|
|
||
|
#[ObservedBy([InterviewScheduleObserver::class])]
|
||
|
class InterviewSchedule extends Model
|
||
|
{
|
||
|
use HasFactory, StatusTrait;
|
||
|
|
||
|
protected $table = 'tbl_interview_schedules';
|
||
|
protected $primaryKey = 'interview_schedule_id';
|
||
|
|
||
|
/**
|
||
|
* The attributes that are mass assignable.
|
||
|
*/
|
||
|
protected $fillable = [
|
||
|
'job_post_id',
|
||
|
'interviewer_choices',
|
||
|
'interviewer_approved',
|
||
|
'scheduled_date',
|
||
|
'scheduled_time',
|
||
|
'arranged_date',
|
||
|
'interview_mode',
|
||
|
'arranged_by',
|
||
|
'createdBy',
|
||
|
'updatedBy',
|
||
|
'status',
|
||
|
'description',
|
||
|
'remarks',
|
||
|
];
|
||
|
|
||
|
public $appends = ['status_name'];
|
||
|
|
||
|
protected $casts = [
|
||
|
'interviewer_choices' => 'array',
|
||
|
'interviewer_approved' => 'array',
|
||
|
'arranged_date' => 'date',
|
||
|
'scheduled_time' => 'datetime',
|
||
|
|
||
|
];
|
||
|
|
||
|
public function jobPost()
|
||
|
{
|
||
|
return $this->belongsTo(JobPost::class, 'job_post_id');
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|