I have a Laravel form, created with a Laravel Form Helper. The thing is I want each of this fields to be unique. So I declared a counter variable like so:
{{counter=0}}
I increment this variable inside my foreach loop, so I can use it on a on the ID element of each input, like so:
{{Form::text('company_lookup', null, ['class'=>'form-control typeahead', 'id'=>'company_lookup_{{$counter}}', 'placeholder' => 'Type company registration number or name'])}}
What is the right syntax to do this?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire