0

I am a beginner with Laravel and PHP.

I'd like to add two variables together (LBV + RBV), so that I display a total value:

<td><span class="lbv"></span></td>
<td><span class="rbv"></span></td>

I have tried adding this snippet but no luck yet:

collect([$lbv, $rbv])->sum();
matiaslauriti
  • 7,065
  • 4
  • 31
  • 43
Lee Bossa
  • 1
  • 2

1 Answers1

0

I think we directly add two variable in laravel blade itself like this

<td><span class="total">{{$lbv+$rbv}}</span></td>

I hope it solves your issue

Saravana Sai
  • 103
  • 9