first commit
This commit is contained in:
69
Modules/Recruit/app/Models/JobPost.php
Normal file
69
Modules/Recruit/app/Models/JobPost.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Recruit\Models;
|
||||
|
||||
use App\Traits\StatusTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Admin\Models\Department;
|
||||
use Modules\Admin\Models\Departments;
|
||||
use Modules\Admin\Models\Designation;
|
||||
use Modules\Admin\Models\Designations;
|
||||
use Modules\Employee\Models\Employee;
|
||||
use Modules\Recruit\Database\factories\JobPostFactory;
|
||||
|
||||
class JobPost extends Model
|
||||
{
|
||||
|
||||
use StatusTrait;
|
||||
|
||||
protected $table = 'tbl_job_posts';
|
||||
protected $primaryKey = 'job_post_id';
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'alias',
|
||||
'vacancy_no',
|
||||
'department_id',
|
||||
'designation_id',
|
||||
'post_date',
|
||||
'expiry_date',
|
||||
'status',
|
||||
'description',
|
||||
'remarks',
|
||||
'createdBy',
|
||||
'updateBy',
|
||||
];
|
||||
|
||||
public $appends = ['status_name'];
|
||||
|
||||
public function department()
|
||||
{
|
||||
return $this->belongsTo(Department::class, 'department_id');
|
||||
}
|
||||
|
||||
public function designation()
|
||||
{
|
||||
return $this->belongsTo(Designation::class, 'designation_id');
|
||||
}
|
||||
|
||||
public function jobPoster()
|
||||
{
|
||||
return $this->belongsTo(Employee::class, 'createdBy');
|
||||
}
|
||||
|
||||
public function interviewSchedules()
|
||||
{
|
||||
return $this->hasMany(InterviewSchedule::class, 'job_post_id');
|
||||
}
|
||||
|
||||
public function jobApplications()
|
||||
{
|
||||
return $this->hasMany(JobApplication::class, 'job_post_id');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user