4

here is my code ..

@foreach (Session::get('show_my_data') as $key1 => $value1)
    <div class="sb_li">
        <input id="sb_system_input_{{ $value1->Myid }}" class="fr_cap" type="text" disabled name="fr_cap[{{ $value1->Myid }}]" value="{{ $value1->FRCapacity }}" maxlength="127"/>
    </div>
    @foreach ($m002_siteinfo as $key => $value)
        @if({{!$value1->name}})
        <div class="sb_li">
            <input id="sb_system_input_{{ $value->Myid }}" class="fr_cap" type="text" disabled name="fr_cap[{{ $value->Myid }}]" value="" maxlength="127"/>
        </div>
        @endif
    @endforeach 
@endforeach 

I am trying to display values of Second foreach which is not there in first foreach using if condition in the middle, but iam getting syntax error in Laravel ,Blade templete.. any ways to fix this??

Jeff Puckett
  • 37,464
  • 17
  • 118
  • 167
Friend
  • 1,326
  • 11
  • 38
  • 62

1 Answers1

14

You don't need the {{ }} syntax inside the @if

You can just write

@if(!$value1->name) 
Needpoule
  • 4,476
  • 24
  • 33