49 lines
1.1 KiB
PHP
49 lines
1.1 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace Modules\Estimate\Models;
|
||
|
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||
|
use Modules\Billing\Models\BillingComponent;
|
||
|
use Modules\Estimate\Database\Factories\EstimateDetailFactory;
|
||
|
|
||
|
class EstimateDetail extends Model
|
||
|
{
|
||
|
use HasFactory, SoftDeletes;
|
||
|
|
||
|
protected $table = "tbl_estimate_details";
|
||
|
/**
|
||
|
* The attributes that are mass assignable.
|
||
|
*/
|
||
|
protected $fillable = [
|
||
|
'title',
|
||
|
'estimate_id',
|
||
|
'billing_component_id',
|
||
|
'fiscal_year_id',
|
||
|
'price',
|
||
|
'qty',
|
||
|
'tax_amount',
|
||
|
'createdBy',
|
||
|
'updatedBy',
|
||
|
'remarks',
|
||
|
'status',
|
||
|
];
|
||
|
|
||
|
|
||
|
public function estimate()
|
||
|
{
|
||
|
return $this->belongsTo(Estimate::class, 'estimate_id')->withDefault();
|
||
|
}
|
||
|
|
||
|
public function billingComponent()
|
||
|
{
|
||
|
return $this->belongsTo(BillingComponent::class, 'billing_component_id')->withDefault();
|
||
|
}
|
||
|
|
||
|
public function getFillableFields()
|
||
|
{
|
||
|
return (new self())->fillable;
|
||
|
}
|
||
|
}
|