Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ArchStanton's avatar

Laravel 4 - adding classes if valid

I have a laravel 4 form and I add some bootstrap classes when it fails validation

<div class="form-group @if ($errors->has('name')) has-error has-feedback @endif">

I also want to add some when it is valid. Is there a way to access this validator variable to check if the field has passed validation in the blade template?

0 likes
1 reply
tomopongrac's avatar

if field not in errors then that field pass the validation...

Please or to participate in this conversation.