34 lines
971 B
PHP
34 lines
971 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
class InvoiceDetail extends BaseModel
|
|
{
|
|
public $timestamps = false;
|
|
use HasFactory;
|
|
/**
|
|
* The table associated with the model.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $table = 'invoice_details';
|
|
|
|
protected $fillable = ['invoice_id', 'test_sample_id', 'test_name', 'weight', 'qty', 'unit_price', 'discount_type', 'discount', BaseModel::CREATED_AT_FIELD, BaseModel::CREATED_BY_FIELD,
|
|
BaseModel::UPDATED_AT_FIELD, BaseModel::UPDATED_BY_FIELD, BaseModel::RECORD_STATUS_FIELD
|
|
];
|
|
|
|
protected $hidden = [BaseModel::CREATED_AT_FIELD, BaseModel::CREATED_BY_FIELD, BaseModel::UPDATED_AT_FIELD, BaseModel::UPDATED_BY_FIELD, BaseModel::RECORD_STATUS_FIELD];
|
|
|
|
public static function boot()
|
|
{
|
|
parent::boot();
|
|
}
|
|
|
|
public function testSample(){
|
|
return $this->belongsTo(TestSample::class, 'test_sample_id', 'id');
|
|
}
|
|
|
|
|
|
}
|