- PmisEquipmentController: 장비 CRUD API - PmisEquipment 모델 추가 - 3개 탭: 장비등록(CRUD), 출역현황, 투입현황 - 장비정보 모달 (저장/수정/삭제) - API 라우트 추가 (equipments)
43 lines
960 B
PHP
43 lines
960 B
PHP
<?php
|
|
|
|
namespace App\Models\Juil;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class PmisEquipment extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'pmis_equipments';
|
|
|
|
protected $fillable = [
|
|
'tenant_id',
|
|
'company_name',
|
|
'equipment_code',
|
|
'equipment_name',
|
|
'specification',
|
|
'unit',
|
|
'equipment_number',
|
|
'operator',
|
|
'inspection_end_date',
|
|
'inspection_not_applicable',
|
|
'insurance_end_date',
|
|
'insurance_not_applicable',
|
|
'options',
|
|
];
|
|
|
|
protected $casts = [
|
|
'inspection_end_date' => 'date',
|
|
'inspection_not_applicable' => 'boolean',
|
|
'insurance_end_date' => 'date',
|
|
'insurance_not_applicable' => 'boolean',
|
|
'options' => 'array',
|
|
];
|
|
|
|
public function scopeTenant($query, $tenantId)
|
|
{
|
|
return $query->where('tenant_id', $tenantId);
|
|
}
|
|
}
|