Files
sam-manage/app/Models/Juil/PmisWorkReportMaterial.php

40 lines
862 B
PHP
Raw Normal View History

<?php
namespace App\Models\Juil;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class PmisWorkReportMaterial extends Model
{
use SoftDeletes;
protected $table = 'pmis_work_report_materials';
protected $fillable = [
'tenant_id',
'report_id',
'material_name',
'specification',
'unit',
'design_qty',
'prev_cumulative',
'today_count',
'sort_order',
'options',
];
protected $casts = [
'design_qty' => 'decimal:2',
'prev_cumulative' => 'decimal:2',
'today_count' => 'decimal:2',
'options' => 'array',
];
public function report(): BelongsTo
{
return $this->belongsTo(PmisDailyWorkReport::class, 'report_id');
}
}