Reputation: 170
I dont know the way to leave the the form text empty is there is no result.I need something like this.....
If there is no userCreator = form text empty
My code
<div class="col-md-4">
<div class="form-group">
{{ Form::label('userCreator','UserCreator') }}
@if(isset($userCreator))
@foreach($userCreator as $cs)
{{ Form::text('userCreator',$cs->home_lastname,['class'=>'form-control']) }}
@endforeach
@else{ {{-- What should i put inside here ? --}}
}
@endif
</div>
</div>
Upvotes: 0
Views: 49
Reputation: 93
try this ...
<div class="col-md-4">
<div class="form-group">
{{ Form::label('userCreator','UserCreator') }}
@if(!empty($userCreator))
@foreach($userCreator as $cs)
{{ Form::text('userCreator',$cs->home_lastname,['class'=>'form-control']) }}
@endforeach
@else
{{ Form::text('userCreator','', ['class'=>'form-control']) }}
@endif
</div>
</div>
Upvotes: 1
Reputation: 163788
@if(isset($userCreator) && count($userCreator) > 0)
<div class="col-md-4">
<div class="form-group">
{{ Form::label('userCreator','UserCreator') }}
@foreach($userCreator as $cs)
{{ Form::text('userCreator',$cs->home_lastname,['class'=>'form-control']) }}
@endforeach
</div>
</div>
@endif
Upvotes: 2