在控制器验证后如何检查旧数据是否可用?我用过这个但它显示错误
@if(\Illuminate\Http\Request::old('status')!=null)
<option style="display: none" value="{{old('status')}}" hidden>{{old('status')}}</option>
@endif
也用过这个
@if(isset(old('status')))
<option style="display: none" value="{{old('status')}}" hidden>{{old('status')}}</option>
@endif
完整形式是
<form action="{{route('add-expense-store')}}" method="post" class="new-added-form">
{{ @csrf_field() }}
<div class="row">
<div class="col-xl-8 col-lg-8 col-12 form-group">
<label>Expense Type</label>
<select class="select2" name="type">
<option value="">Please Select</option>
{{--<option value="Teacher's Salary">Teacher's Salary</option>
<option value="Staff's Salary">Staff's Salary</option>--}}
<option value="Transport">Transport</option>
<option value="Mobile Bill">Mobile Bill</option>
<option value="Utility Bill">Utility Bill</option>
<option value="Stationary">Stationary</option>
<option value="Print & Press">Print & Press</option>
<option value="Photocopy & Compose">Photocopy & Compose</option>
<option value="Entertainment & Hospitality">Entertainment & Hospitality</option>
<option value="Donation">Donation</option>
<option value="Program">Program</option>
<option value="Personal or Owner">Personal or Owner</option>
</select>
</div>
两者都出错。我如何检查我们在刀片中是否可用的旧值?
现在我包括我的表单数据。如果找不到旧值,我想在这里隐藏。请帮忙解决这个问题。检查刀片中的旧数据。
杨__羊羊