StocksNew/Modules/Recruit/app/Models/JobApplication.php
Sampanna Rimal 53c0140f58 first commit
2024-08-27 17:48:06 +05:45

56 lines
1.3 KiB
PHP

<?php
namespace Modules\Recruit\Models;
use App\Models\Document;
use App\Traits\StatusTrait;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Notifications\Notifiable;
use Modules\Recruit\Database\factories\JobApplicationFactory;
class JobApplication extends Model
{
use HasFactory, StatusTrait, Notifiable;
protected $table = 'tbl_job_applications';
protected $primaryKey = 'job_application_id';
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'name',
'address',
'phone',
'email',
'gender',
'job_post_id',
'working_experience',
'prev_company',
'working_mode',
'working_type',
'working_shift',
'apply_date',
'recommended_by',
'status',
'description',
'remarks',
'createdBy',
'updatedBy',
];
protected $casts = [
'apply_date' => 'date',
];
public $appends = ['status_name'];
public function jobPost()
{
return $this->belongsTo(JobPost::class, 'job_post_id');
}
public function documents()
{
return $this->morphMany(Document::class, 'documentable');
}
}