Best Form Validation library for Slim


#1

I am using Slim 3 for Rest Api, and i need to validate data coming from frontend like not empty, number, email…
Please suggest me any easy to use library for this.


#2

These are both popular, I use vlucas/valitron in many of my projects.


#3

I use - https://github.com/DavidePastore/Slim-Validation


#4

PHP has built in functions:

not empty => !empty($var)
number => is_numeric($var) or is_int($var) or is_float($var)
is email: filter_var($email, FILTER_VALIDATE_EMAIL) !== false


#5

Thanks for your reply, i will try vlucas/valitron :slight_smile:


#6

maybe you like this : https://github.com/nanaksr/validator