PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, January 24, 2022

[FIXED] How to do arithmetic operations in Laravel blade view?

 January 24, 2022     laravel-5, php     No comments   

Issue

I want to do subtraction operations inside the Laravel blade view. I knew it was the wrong approach I need to do it from the controller, but can someone give me the proper solution to do it directly inside the blade view?

Note: I am a newbie to programming.

Here is my code

@if(!empty($receipt_details->total_due))
<tr>
    <th>
        Customer Old Due
    </th>
    <td>
        {{$receipt_details->all_due}} - {{$receipt_details->total_due}}
    </td>
</tr>
@endif

Solution

you can add it at the same {{}} like this one

{{$receipt_details->all_due - $receipt_details->total_due}}


Answered By - Joseph
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing