So I have this forelse that displays all the variants, now what I want to happen is that, if there is no variant. the submit button will be disabled.
<table class="table table-striped">
<thead>
<tr>
<th class="col-sm-5">Name</th>
<th class="col-sm-1">Default?</th>
<th class="col-sm-2 text-right">Retail Price</th>
<th class="col-sm-2 text-right">Quantity</th>
<th class="col-sm-2"></th>
</tr>
</thead>
<tbody>
@forelse ($product->variants as $index => $variant)
<tr>
<td></td>
<td></td>
<td class="text-right"> </td>
<td class="text-right"></td>
<td><a href="" class="btn btn-xs btn-default pull-right">Edit</a></td>
</tr>
@empty
<tr>
<td colspan="5">No variants found</td>
<?php $varbutton = 'disabled';?>
</tr>
@endforelse
</tbody>
</table>
here is the button
<div class="panel-footer">
<button class="btn btn-default" type="submit"<?php $varbutton; ?>>Update Store</button>
</div>
Is it possible using php and html in the blade alone or do I have to do it in the controller?
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2NmM2sO
via IFTTT
Aucun commentaire:
Enregistrer un commentaire