init project

This commit is contained in:
2026-05-25 11:08:52 +07:00
parent a388c619b5
commit 895fdd9b83
1437 changed files with 384844 additions and 27 deletions

39
app/Models/TestResult.php Normal file
View File

@@ -0,0 +1,39 @@
<?php
namespace App\Models;
use App\Enums\RecordStatusEnum;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class TestResult extends BaseModel
{
public $timestamps = false;
use HasFactory;
/**
* The table associated with the model.
*
* @var string
*/
//protected $appends = ['usd_price'];
public static function boot()
{
parent::boot();
}
protected $fillable = ['sample_id', 'test_sample_id','test_result', 'is_show', 'test_date', 'performed_by', 'lab_id', BaseModel::CREATED_AT_FIELD, BaseModel::CREATED_BY_FIELD];
function testSample(){
return $this->belongsTo(TestSample::class,'test_sample_id','id')->where(BaseModel::RECORD_STATUS_FIELD, RecordStatusEnum::ACTIVE);
}
// function organismResults(){
// return $this->hasMany(OrganismResult::class,'test_result_id','id')->where(BaseModel::RECORD_STATUS_FIELD, RecordStatusEnum::ACTIVE);
// }
// function getUsdPriceAttribute(){
// return TestSample::query()->find($this->test_sample_id)->first()->usd_price;
// }
}