I need to create a new array inside a blade and then post it within a request, but it just keeps spitting out the id's as key value pairs.
I need a named array that I can specifically target and iterate through... any suggestion??
@foreach ($allTheAgreements as $agreement)
<tr>
<td><input type="checkbox" name="{{$agreementID[] = $agreement->id}}" id="{{ $agreement->id }}"
value="{{ $agreement->id }}">
</td>
<td>{{ $agreement->id }}</td>
<td>{{ $agreement->agreement_type }}</td>
<td>Agreement Status</td>
</tr>
@endforeach
So how do I initialise a new array within a blade template input element and get the indexed values back?
Something like
$arrayWithinRequest[] = [ 0 => '2', 1 => '5', 2 => '7'};

<input type="checkbox" name="agreements[{{$agreement->id}}]" id="{{ $agreement->id }}" value="{{ $agreement->id }}">