如何更改 Laravel 中的值更改文本

问题描述

我想在更改 TVA 值时更改文本 但最终结果相同 在这两种情况下它们都显示为“NET TTC”

功能

for /D %%y in (*) do (
    start cmd /k cd %%y & npm i
)

显示

    public function invoice()
    {
        return $this->belongsTo(Invoice::class,'invoice_id','id');
    }
    public function tvaText(){ 
        if( $this->TVA_value == 0 ){
            $this->tva_text='NET TTC';
        }elseif($this->TVA_value != 0){
            $this->tva_text='Total TTC';
        }
        return $this->tva_text;
    }

enter image description here

enter image description here

请看图片,以便您清楚我的意思 有谁知道如何更改文本或任何其他方法来实现?

解决方法

您可以在刀片上轻松完成。

 @if($invoice->TVA_value == 0 )         
      <td>NET TTC</td>         
@else
      <td> Total TTC </td>        
@endif