45 lines
907 B
PHP
45 lines
907 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models\Juil;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||
|
|
|
||
|
|
class PmisConstructionWorker extends Model
|
||
|
|
{
|
||
|
|
use SoftDeletes;
|
||
|
|
|
||
|
|
protected $table = 'pmis_construction_workers';
|
||
|
|
|
||
|
|
protected $fillable = [
|
||
|
|
'tenant_id',
|
||
|
|
'company_name',
|
||
|
|
'trade_name',
|
||
|
|
'job_type_id',
|
||
|
|
'name',
|
||
|
|
'phone',
|
||
|
|
'birth_date',
|
||
|
|
'ssn_gender',
|
||
|
|
'wage',
|
||
|
|
'blood_type',
|
||
|
|
'remark',
|
||
|
|
'options',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $casts = [
|
||
|
|
'wage' => 'integer',
|
||
|
|
'options' => 'array',
|
||
|
|
];
|
||
|
|
|
||
|
|
public function jobType(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(PmisJobType::class, 'job_type_id');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function scopeTenant($query, $tenantId)
|
||
|
|
{
|
||
|
|
return $query->where('tenant_id', $tenantId);
|
||
|
|
}
|
||
|
|
}
|