EMfinanga
1 month ago
167
3
Laravel

if statement in blade

Posted 1 month ago by EMfinanga

how can i apply this statement in my tag as my code below, or what is the best way i can use this

                 @foreach($inwards as $key=>$dt)
           
            <tr>
              <td>{{$dt->created_at->format('Y-m-d')}}</td>
              <td>{{$dt->vch_no}}</td>
              <td>{{$dt->l_type}}</td>
              <td>{{$dt->items->name}}</td>


        @if($dt->l_type == "purchase")
              <td>{{$dt->quantity}}</td>
              <td>{{$dt->rate}}</td>
              <td>{{$dt->amount}}</td>
            
             //i want to display data here which this column is much
          @elseif($dt->l_type == "credit_sale" and "cash_sale")
              <td>{{$dt->quantity}}</td>
              <td></td>

              <td>{{$dt->rate}}</td>
              <td>{{$dt->amount}}</td>
             @endif
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              
            </tr>

Please sign in or create an account to participate in this conversation.