【发布时间】:2021-04-16 09:01:37
【问题描述】:
这是productObserver。
public function updating(product $product)
{
if ($product->Qty <= $product->ReOrderLevel){
$product->Status='Reorder level';}
else if ($product->Qty >$product->ReOrderLevel ){
$product->Status='In Stock';}
if ($product->Qty <= 0) {
$product->Status = 'Out of Stock';}
}
这是产品视图。它显示产品的所有详细信息和产品的状态。在这里,我想在状态变为重新订购级别时以红色显示状态。
<table>
<tr >
<th >@sortablelink('Name')</th>
<th >Product View</th>
<th >Brand</th>
<th >@sortablelink('Price')</th>
<th >@sortablelink('Qty')</th>
<th>Stock_Defective</th>
<th >Status</th>
<th >Action</th>
</tr>
@foreach($products as $product)
<tr>
<td>{{$product['Name']}}</td>
<td> <img src="{{asset('uploads/product/'.$product->image) }}"
class="img-circle" width="100px;" height="100px;" alt="Product-Image"> </td>
<td>{{$product['Brand']}}</td>
<td>{{$product['Price']}}</td>
<td>{{$product['Qty']}}</td>
<td>{{$product->stock_defective}}</td>
<td>{{$product['Status']}}</td>
</tr>
@endforeach
</table>
How I change text colour to red when updating product status as Reorder level ?
【问题讨论】:
-
欢迎来到 SO ... 你能发布到目前为止你为完成工作所做的努力吗?并且不要发布不必要的代码很难找到解决方案
-
@KamleshPaul 我删除了不必要的细节。你能找到解决办法吗?
-
请检查我发布的答案
-
@KamleshPaul 谢谢
-
欢迎您:D ...
标签: laravel eloquent laravel-8