cpkpdg
Last Updated: February 25, 2016
·
547
· codesionuk

Displaying errors on Laravel forms

We're using Bootstrap 3 with Laravel to create more user friendly error messages by adding the "form-error" class to each input failing validation.

{{ Form::email("email", array("class"=>"form-control " . ($errors->first('email') ? 'form-error' : ''),"placeholder"=>"luke.skywalker@jedi.ninja")) }}

Then styling the input with a red border

.form-error {  
border: 1px solid #e74c3c
}