Laravel 5.1 Validators
Last week I was building a backend tool in Laravel, where you could create layout in bootstrap 3 and add CSS selectors
like id or class to any container. You wanted to be able to enter more than one class name into input field. Let’s say
that you want to add 2 classes: col-xs-6 infoBox_4
. Laravel hasn’t validator for this type of string, so I decided to
make one. I needed to have validator which accepts alphabetic characters, numbers, underscore symbols,
hyphens and spaces. I didn’t want to make it over complex, but still wanted to validate that users enters valid
css selectors.