So my question is how to mark/show messages via javascript after server-side validation. I know there's the $errors
inside blade views but there's no way of telling which element could not be validated. The only way of knowing is to do $errors->first(...)
but then you get stuck with only this frustrating option:
<div class="form-group {{ $errors->has('password') ? 'has-error' : '' }}">
<input type="password" class="form-control" {{ $errors->has('password') ? 'title=' . $errors->first('password') : '' }} placeholder="Password" name="password" required="required">
</div>
While it's acceptable to do that, I'm aiming at reusability, something that can be easily implemented and troubleshot later on other pages.
Any idea would be appreciated.