I'm using the Laracasts\Validation\FormValidator package
how would I setup validation rules for each unique stock field?
<?php namespace Acme\Forms;
use Laracasts\Validation\FormValidator;
class SubmittradeForm extends FormValidator {
protected $rules = [
'stock_id' => 'required',//is unique for each stock
];
}
@foreach($stocks as $stock)
<div class="pull-right hidden-sm text-right m-t" style="padding-top:10px;">
<div class="">
<label class="btn btn-success" ng-model="radioModel" btn-radio="'true'">UP</label>
<input type="hidden" name="{{$stock->id}}" id="{{$stock->id}}" value="@{{radioModel || 'null'}}">
</div>
<div class="" style="padding-top:5px;">
<label class="btn btn-danger" ng-model="radioModel" btn-radio="'false'" uncheckable>DOWN</label>
</div>
{{ errors_for('$stock->id', $errors) }}
</div>
@endforeach
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community