first commit
This commit is contained in:
41
app/Models/ChecklistFormula.php
Normal file
41
app/Models/ChecklistFormula.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class ChecklistFormula extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'checklist_template_id',
|
||||
'checklist_section_id',
|
||||
'result_token',
|
||||
'label',
|
||||
'expression',
|
||||
'unit',
|
||||
'guard_div_zero',
|
||||
'order',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'guard_div_zero' => 'boolean',
|
||||
'order' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
public function template(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(ChecklistTemplate::class, 'checklist_template_id');
|
||||
}
|
||||
|
||||
public function section(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(ChecklistSection::class, 'checklist_section_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user