Итак, у меня есть этот forelse, который отображает все варианты, теперь я хочу, чтобы, если вариантов нет. кнопка отправки будет отключена.
<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>{{ $variant->name }}</td>
<td>{{ $variant->is_default ? 'Yes' : 'No' }}</td>
<td class="text-right">{{ number_format($variant->retail_price, 2) }} {{ $variant->price_currency }}</td>
<td class="text-right">{{ number_format($variant->quantity, 0) }}</td>
<td><a href="{{ route('developer.variants.edit', [$store->slug, $product, $variant]) }}" 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>
вот кнопка
<div class="panel-footer">
<button class="btn btn-default" type="submit"<?php $varbutton; ?>>Update Store</button>
</div>
Возможно ли использовать php и html только на блейде или мне нужно сделать это в контроллере?