Validate if name is required

This commit is contained in:
snipe 2018-10-05 00:46:27 -07:00
parent 6f71abd0e0
commit 907d1d0f61

View file

@ -2,7 +2,7 @@
<div class="form-group {{ $errors->has('name') ? ' has-error' : '' }}">
<label for="name" class="col-md-3 control-label">{{ $translated_name }}</label>
<div class="col-md-7 col-sm-12{{ (\App\Helpers\Helper::checkIfRequired($item, 'name')) ? ' required' : '' }}">
<input class="form-control" type="text" name="name" id="name" value="{{ Input::old('name', $item->name) }}" />
<input class="form-control" type="text" name="name" id="name" value="{{ Input::old('name', $item->name) }}" {!! (\App\Helpers\Helper::checkIfRequired($item, 'name')) ? ' data-validation="required"' : '' !!}>
{!! $errors->first('name', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
</div>
</div>
</div>