I'm new to the Laravel universe and I'm putting the finishing touches on an ecommerce app. The final frontier now is getting the dynamic shipping rate, and adding it to my overall order total, but I'm at a loss as to how to do this. The rates are coming through a foreach loop like this
<?php $i = 0; ?>
@foreach ($rates as $rate)
<tr>
<td>
<img src="{{ $rate->provider_image_75 }}" alt="">
{{ $rate->provider }} ({{ $rate->duration_terms }})
</td>
<td width="20%">
<input type="radio" class="pull-right" name="rate_{{$i}}" value="{{ $rate->object_id }}">
${{ $rate->amount }}
</td>
</tr>
<?php $i++; ?>
But all the inputs are selectd when I click on them. Because I have the code directly in the laravel blade, I'm not using the controller. I'm unsure on how to get the selected rate, and only the selected rate to be added to the $cartTotal variable. I need a little more clarification on this, because I'm new to php development. Thanks.